FW: Switch statements again

Skip Montanaro skip at pobox.com
Thu Jan 16 07:45:30 EST 2003


    Dan> Why not have optional, explicit fallthru?

Because it does not match Python's indentation philosophy very well.  There
is no other block in Python where you do something like

    if some condition:
        do stuff
        ignore the next condition and execute its code anyway
    elif some other condition:
        do more stuff

I think it would be error-prone besides.  The logic of your programming
would be sensitive to the ordering of your blocks.

Folks, feel free to write the author of PEP 275 with your comments or submit
feature requests (with a patch to the PEP would be nice) on Sourceforge
which reference the PEP so someone can keep track of your inputs.  Otherwise
they are likely to get missed and forgotten about, and if and when Python
gains something like a switch statement there will be a bunch of disgruntled
people asking, "but what about my great idea?"

Skip





More information about the Python-list mailing list