[issue37757] TargetScopeError not raised for comprehension scope conflict

Nick Coghlan report at bugs.python.org
Tue Aug 13 22:39:33 EDT 2019


Nick Coghlan <ncoghlan at gmail.com> added the comment:

The outcome of the python-dev discussion was that we agreed to switch to raising a plain SyntaxError, as that's what we do everywhere else that this kind of problem comes up (e.g. conflicts between global and nonlocal declarations, or between those and parameter declarations, as well as the various other cases of "that statement/expression is fine in isolation, but you can't use it *here*").

Both PRs have been updated accordingly, and the PEP PR has been merged.

----------

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


More information about the Python-bugs-list mailing list