[Python-Dev] closure semantics
Skip Montanaro
skip at pobox.com
Fri Oct 24 08:41:17 EDT 2003
More information about the Python-Dev mailing list
Fri Oct 24 08:41:17 EDT 2003
- Previous message: [Python-Dev] closure semantics
- Next message: [Python-Dev] closure semantics
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tim> Likewise, the following should be illegal:
Tim> def f():
Tim> x = 12
Tim> y = 1
Tim> def g():
Tim> global y in f
Tim> y = 12
Tim> g()
Tim> print locals()
Tim> because the global statement occurs after a local binding of the
Tim> name.
You meant
def f():
x = 12
y = 1
def g():
y = 12
global y in f
g()
print locals()
right?
Skip
- 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