statically nested scopes
Robin Becker
robin at jessikat.fsnet.co.uk
Sat Nov 4 10:07:33 EST 2000
I see that python dev is discussing nested scopes. Not being one of the
elect I would like to ask a question here.
J Hylton claims that it should be easy to distinguish module globals and
those from an enclosing scope.
How can this work when different paths define different variables.
ie
G=0
def A():
for i in range(3):
if i>=2:
G=i*i
def B():
return G+2
print B()
ie is the code going to define B differently on every pass as it should
and if it does so this style seems absolutely rotten. What happens if G
gets defined in A after B gets built, but before it gets called.
--
Robin Becker
More information about the Python-list
mailing list