[Python-ideas] Yet Another Switch-Case Syntax Proposal
Stephen J. Turnbull
stephen at xemacs.org
Sat Apr 19 07:11:16 CEST 2014
Skip Montanaro writes:
> In other languages, the semantics of the switch statement allow the
> compiler to generate more efficient code. Instead of testing each
> branch of the if statement in succession looking for a match, you
> evaluate the switch expression once, then use it as an index into a
> jump table of some sort which points directly to the matching case
> label.
Sure, but Python already has such a jump table: a function-valued
hash.
Don't-even-think-of-mentioning-Ruby-blocks-now-ly y'rs,
More information about the Python-ideas
mailing list