FW: Switch statements again

A. Lloyd Flanagan alloydflanagan at attbi.com
Thu Jan 16 09:34:53 EST 2003


"David K. Trudgett" <dkt at registriesltd.com.au> wrote in message news:<mailman.1042695688.821.python-list at python.org>...
> That's interesting. I didn't know about that. What's Guido's take on
> it? (Since he seems to be the "Python Dictator".)

The correct title is "Benevolent Dictator For Life", frequently
abbreviated as BDFL.  There are severe penalties for ommitting the
"Benevolent", involving imprisonment and torture.  :)

> 
> Personally, I would go with the syntax change. Or maybe we should all

One thing I like about Python is that it's not cluttered up with a
whole lot of syntax.  On the other hand, 'switch' doesn't seem like a
bad idea.  Two suggestions:

1.  Call it something besides 'switch', which IMHO is not intuitive as
to its meaning.  How about something like 'select case'?
2.  Allow me to cast an emphatic vote agains fall-through, implicit or
explicit.  It obfuscates the code too much for the rare cases when
it's beneficial.  And
case 5:
    printf("something");
    break;
is at least one line longer than it has any reason to be.




More information about the Python-list mailing list