[New-bugs-announce] [issue8819] variable resolution within exec() incorrect

Colin Hawkett report at bugs.python.org
Tue May 25 18:49:08 CEST 2010


New submission from Colin Hawkett <hawkett at gmail.com>:

A discussion on stack overflow - http://stackoverflow.com/questions/2904274/globals-and-locals-in-python-exec - has led to the conclusion that the variable lookup behaviour within code run using exec() is not behaving as expected. Variable lookup inside a class definition does not search the enclosing scope's locals() prior to issuing a NameError - there are full details and test cases at the above URL.

----------
components: None
messages: 106447
nosy: hawkett
priority: normal
severity: normal
status: open
title: variable resolution within exec() incorrect
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8819>
_______________________________________


More information about the New-bugs-announce mailing list