[issue43448] exec() ignores scope.

Eryk Sun report at bugs.python.org
Tue Mar 9 11:41:50 EST 2021


Eryk Sun <eryksun at gmail.com> added the comment:

exec(obj, globals(), locals()) is the same as exec(obj). Also, locals in a function scope are optimized, so the locals() dict is a snapshot. Modifying the snapshot dict doesn't modify the optimized local variables. At most I think this issue is a duplicate of bpo-24800, to clarify the implicit local scope and behavior.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43448>
_______________________________________


More information about the Python-bugs-list mailing list