On 28/02/2014 11:38, Marko Rauhamaa wrote:
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.


There are umpteen recipes for switch statements so take your pick or if you don't like any of them write your own. Much easier than beating your head against multiple brick walls, which is what raising this one on python-ideas is likely to be. See http://legacy.python.org/dev/peps/pep-0275/ and http://legacy.python.org/dev/peps/pep-3103/

--
My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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

Reply via email to