[Python-Dev] Simple Switch statement

Aahz aahz at pythoncraft.com
Sun Jun 25 03:34:41 CEST 2006


On Sat, Jun 24, 2006, Raymond Hettinger wrote:
>
> So, that is it, my proposal for simple switch statements with a
> straight-forward implementation, fast execution, simply explained
> behavior, and applicability to to the most important use cases.

+1

I've been trying to write a response to these threads.  I don't
particularly like what looks like an attempt to shove together too many
different features into a single package.  Raymond's proposal gives
Python the switch statement people have been demanding while leaving room
for the improvements that have been suggested over a plain switch.

Phillip's point about longs and Unicode is valid, but easily addressed by
limiting cases to "hashable literal" (though we might want to explicitly
exclude floats).
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes


More information about the Python-Dev mailing list