[Python-Dev] PEP 572 semantics

Chris Angelico rosuav at gmail.com
Thu Jul 5 20:17:43 EDT 2018


On Fri, Jul 6, 2018 at 10:17 AM, Guido van Rossum <guido at python.org> wrote:
>> I'm still wondering if it might make sense to define a new
>> "TargetScopeError" subclass of SyntaxError for that last case, since it
>> isn't the assignment expression syntax itself that's the problem: it's where
>> that expression is located.
>
>
> Yeah, that would be a good idea. (Though do we currently have any subclasses
> of SyntaxError? And if so, do any of them have a name that does not include
> the substring "SyntaxError"?)
>

There's IndentationError. +1 on the dedicated exception type.

ChrisA


More information about the Python-Dev mailing list