[Python-Dev] Switch statement (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 16 06:13:34 CEST 2006
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
M.-A. Lemburg wrote:
My personal favorite is making the compiler smarter to detect the mentioned if-elif-else scheme and generate code which uses a lookup table for implementing fast branching.
But then the values need to be actual compile-time constants, precluding the use of symbolic names, values precomputed a run time, etc.
A new statement would allow us to simply document that the case values are assumed constant, and then the implementation could cache them in a dict or whatever.
-- Greg
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]