[Python-Dev] closure semantics
Delaney, Timothy C (Timothy)
tdelaney at avaya.com
Sun Oct 26 22:27:52 EST 2003
More information about the Python-Dev mailing list
Sun Oct 26 22:27:52 EST 2003
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] closure semantics
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> From: Guido van Rossum [mailto:guido at python.org] > > > 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. As Skip pointed out, I got: y = 12 global y in f reversed. And I was thinking of PyChecker warning about this. I should not have been thinking about these things while trying to set a release candidate build going so I could head home on a Friday evening :( Tim Delaney
- 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