[Python-Dev] closure semantics
Guido van Rossum
guido at python.org
Fri Oct 24 11:46:35 EDT 2003
More information about the Python-Dev mailing list
Fri Oct 24 11:46:35 EDT 2003
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] cleanup order
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Likewise, the following should be illegal: > > def f(): > x = 12 > y = 1 > def g(): > global y in f > y = 12 > g() > print locals() > > because the global statement occurs after a local binding of the name. Huh? The placement of a global statement is irrelevant -- it can occur anywhere in the scope. This should certainly work. --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] cleanup order
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list