[Python-Dev] Switch statement (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 12 03:06:41 CEST 2006
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
skip at pobox.com wrote:
I agree, but that of course limits the expressions to constants which can be evaluated at compile-time as I indicated in my previous mail.
A way out of this would be to define the semantics so that the expression values are allowed to be cached, and the order of evaluation and testing is undefined. So the first time through, the values could all be put in a dict, to be looked up thereafter.
-- Greg
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]