[Python-Dev] closure semantics
Guido van Rossum
guido at python.org
Fri Oct 24 11:45:17 EDT 2003
More information about the Python-Dev mailing list
Fri Oct 24 11:45:17 EDT 2003
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] closure semantics
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> This made me think. What should be the effect of > > def f(): > x = 12 > def g(): > global y in f > y = 12 > g() > print locals() > > I suspect the answer is "it's illegal". But by extension from the > current behaviour of "global", it should create a local variable in > f. I see no reason why it should be illegal; it should indeed create y in f. --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] closure semantics
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list