[Python-Dev] switch-based programming in Python

Martin v. Loewis martin@v.loewis.de
Wed, 7 Nov 2001 22:21:01 +0100


> Wouldn't it make sense to enable the byte code compiler to take the
> above construct and turn it into a dictionary based switch statement
> ?

That won't work. You cannot know what type "x" has, so you don't know
in advance how "x == 'one'" is evaluated.

Regards,
Martin