[Python-Dev] Switch statement (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jun 25 06:48:14 CEST 2006
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Phillip J. Eby wrote:
1. "case (literal|NAME)" is the syntax for equality testing -- you can't use an arbitrary expression, not even a dotted name.
That's too restrictive. I want to be able to write things like
class Foods: Spam = 1 Eggs = 2 Ham = 3
...
switch f:
case Foods.Spam:
...
case Foods.Eggs:
...
-- Greg
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]