[issue43481] PyEval_EvalCode() namespace issue not observed in Python 2.7.

Chris Morton report at bugs.python.org
Wed Mar 24 11:20:11 EDT 2021


Chris Morton <chrisgmorton at yahoo.com> added the comment:

Is this change in behavior considered to be by design or is this issue an unintended consequence? It seems inconsistent that comprehensions have no visibility of variable previously defined in the same scoping for this particular use-case. Is there a way to work around this other than reworking the comprehension?

It seems odd that [ci for ci in c] does not produce the error but [c for i in [1]] does produce the error.

----------

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


More information about the Python-bugs-list mailing list