On Fri, Apr 18, 2014 at 10:03 AM, Joao S. O. BuenoI haven't been following this thread closely, so I don't know if Lucas
> It may be just me, but I fail - in a complete manner - to see how this
> syntax can offer any
> improvement on current if/elif chains.
has mentioned more than syntax, however...
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. If nothing matches, you jump to the default branch (if one was
defined) or just jump over the entire switch statement (if not).
Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html