Mark Dickinson added the comment:
> At most I think this issue is a duplicate of bpo-24800
Agreed; closing here.
--
nosy: +mark.dickinson
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> exec docs should note that the no argument form in a local
sc
Eryk Sun 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-
New submission from Keepun :
exec() ignores scope.
Code:
--
class ExecTest:
def public(self):
h=None
exec("h='It is public'")
print(h)
self._private()
def _private(self):
h=None
exec("h='It is private'", globals(),