[issue37757] TargetScopeError not raised for comprehension scope conflict

Nick Coghlan report at bugs.python.org
Mon Aug 5 20:33:42 EDT 2019


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

I believe our main motivation for separating it out was the fact that even though TargetScopeError is a compile-time error, the affected code is syntactically fine - there are just issues with unambiguously inferring the intended read/write location for the affected target names. (Subclassing SyntaxError is then a pragmatic concession to the fact that "SyntaxError" also de facto means "CompilationError")

Searching for "Python TargetScopeError" will also get folks to relevant information far more quickly than searching for "Python SyntaxError" will.

Pre-seeding Stack Overflow with an answer to "What does TargetScopeError mean in Python?" would probably be a good idea though (similar to what I did for https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python )

----------

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


More information about the Python-bugs-list mailing list