On 6/23/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Here are a few examples showing my objections against first-use.
[Problem with nested scopes; today this usually shows up as (invalid) bug reports about lambda, in which failure to bind a "default" variable "to itself" causes it to take on the value at the end of the loop, instead of the value of the index when defined.] [Problem with using a parameter as a case selector -- at least these aren't available at definition time.] > With the def-time rule, you'd have to work a lot harder to construct > an example that works differently than the casual reader would expect. Anything which use the same names in the local scope, particularly if those names are themselves marked final (or static). a=1 b=2 c=3 def f(v): a=4 # This gets ignored? final b=5 # But what about this? It is local, but a constant known in advance switch v: case in (a, b, c): ... final c=6 # Also a constant, but textually after the case keyword. -jJ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com