I'm coming from Tcl-world ...

Tim Daneliuk tundra at tundraware.com
Fri Aug 2 11:50:03 EDT 2002


Martin v. Löwis wrote:

>>2.) A 'switch'-thing: like a big if-elif-elif-elif-...-else but
>>which evaluates its expression only once ... and then does all the
>>comparisons.
> 
> 
> PEP 275 proposes to include such a thing. You are encouraged to
> comment on the PEP, either in this group, or by contacting the PEP
> author:
> 
> http://www.python.org/peps/pep-0275.html
> 

This seems to me to just be syntactic sugar and thus unneeded.  Switch/Case
like constructs are trivially, and more richly, implemented using
dictionaries to associate a switch value with a particular behavior or
result.


-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com




More information about the Python-list mailing list