Chris Angelico <ros...@gmail.com>:

> Python currently has dispatch tables and if/elif chains, and a strong
> cultural aversion to switch. You could change that by coming up with
> some *really* awesome proposal, but you'll be fighting against the
> tide a bit.

It's easy have a "cultural aversion" when the language doesn't provide
the facility.

Switch statements provide for excellent readability in parsers and state
machines, for example. They also allow the Python compiler to optimize
the statement internally unlike long if-else chains.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to