This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients
Date 2002-03-13.09:38:05
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=21627

The attached script also has the example

def f(x):
    a = x
    def g():
        print a
        return eval('a')
    return g

f(3)()

which currently produces

3
Traceback (most recent call last):
  File "a.py", line 8, in ?
    f(3)()
  File "a.py", line 5, in g
    return eval('a')
  File "<string>", line 0, in ?
NameError: name 'a' is not defined

I believe this is a bug, since the variable a is referenced
by the program text of the block that contains the call to
eval(); thus, accessing a inside eval should work well;
Reopening.
History
Date User Action Args
2007-08-23 13:59:40adminlinkissue528274 messages
2007-08-23 13:59:40admincreate