Can global variable be passed into Python function?

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Feb 28 10:06:43 EST 2014


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





More information about the Python-list mailing list