[Python-Dev] Switch statement
Jim Jewett
jimjjewett at gmail.com
Fri Jun 23 22:32:48 CEST 2006
More information about the Python-Dev mailing list
Fri Jun 23 22:32:48 CEST 2006
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In http://mail.python.org/pipermail/python-dev/2006-June/066399.html, PJE wrote: >> Python prefers to evaluate expressions in the order that they >> appear in source code, ... "first-time use" preserves that >> property; "function definition time" does not. Guido wrote: > But first-time has the very big disadvantage IMO that there's no > safeguard to warn you that the value is different on a subsequent > execution -- you just get the old value without warning. That is true either way, and is already true with computed default arguments. The only difference is that your mental model has even longer to become inconsistent. (The time between definition and first use.) First time use also lets you use a constant (such as a dotted name from another module) that may not yet be defined when the function is defined, but will be defined before the function is used. -jJ
- Previous message: [Python-Dev] Switch statement
- Next message: [Python-Dev] Switch statement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list