Logged In: YES
user_id=99874
I can confirm this... it appears that things which are set
in the global scope within an "exec ... in {}, {}" are not
then correctly accessed in the global scope when being read.
The following two examples illustrate the problem:
>>> exec """\
... x = 3
... def f():
... global x
... print x
... f()
... """ in {}, {}
3
... and again without the global definition:
>>> exec """\
... x = 3
... def f():
... print x
... f()
... """ in {}, {}
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 4, in ?
File "<string>", line 3, in f
NameError: global name 'x' is not defined |