case/switch statement?

Skip Montanaro skip at pobox.com
Mon Jun 13 13:47:10 EDT 2005


    Terry> Yeah, and I find this even more so:

    Terry> case =  {
    Terry>         5: do_this,
    Terry>         6: do_that,
    Terry>         }
    Terry> case.get(x, do_default)()

    Terry> Which is looking pretty close to a case statement, anyway.

Sure, modulo namespace issues.

Skip



More information about the Python-list mailing list