Message24730
| Author |
mcherm |
| Recipients |
| Date |
2005年03月30日.12:40:31 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:30:26 | admin | link | issue1167300 messages |
| 2007年08月23日 14:30:26 | admin | create |
|