[issue38331] Exec not recognizing global variables inside function

Huyston report at bugs.python.org
Wed Oct 2 10:38:28 EDT 2019


Huyston <prajogaosu at gmail.com> added the comment:

Ronald Oussoren, I understand your comment and it makes sense in the module perspective.

However, when using 'exec', we are explicitly passing a globals dict (and locals) that the target code should consider.

As the documentation states:
"If globals and locals are given, they are used for the global and local variables, respectively."

In my point of view, the function is not considering the given globals and locals dict.

----------

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


More information about the Python-bugs-list mailing list