case/switch statement?

D H d at e.f
Mon Jun 13 22:36:23 EDT 2005


Peter Hansen wrote:
> With a case statement, on the other hand, you *know* that it must be 
> just simple conditionals (a series of x == some_constant tests), so you 
> don't need to look at all the cases, just the one that interests you.

Since you and Steve Holden agree that a case statement is useful, why 
don't you propose it for python, or add it to the wiki page for Python 3000.

Here is the syntax the developers of your favorite language boo ( 
http://boo.codehaus.org/ ) are using:

given x:
     when 1:
         ...
     when 2:
         ...
     otherwise:
         ...


must-stop-hyphenating-ly y'rs



More information about the Python-list mailing list