On Fri, Aug 9, 2019 at 8:07 PM Chris Angelico <rosuav@gmail.com> wrote:
On Sat, Aug 10, 2019 at 12:56 PM Guido van Rossum <guido@python.org> wrote:
>
> On Fri, Aug 9, 2019 at 11:06 AM Barry Warsaw <barry@python.org> wrote:
>>
>> Nick and I are now on the same page, so I don’t think we *have* to have a formal SC vote.
>
>
> OK, I agree. Let's remove TargetScopeError from the PEP and from the implementation. Since that makes three SC members in favor the motion passes. I hope Chris A (the third PEP author) can live with this -- in his last post on the subject that I can find he was still in favor of a subclass of SyntaxError (in any case he's outvoted by the other two PEP authors :-).
>

I was at the time, but it was only a weak recommendation. And having
seen other examples (eg a global statement doubling a function
argument) that just use SyntaxError, I'm totally fine with just making
it SyntaxError with a useful text message.

So go for it! Remove TargetScopeError.

(That said, though: it may be helpful to have some metadata attached
to the exception, like the name that's being assigned to. Not sure how
easy/hard that'll be.)

We don't do that for any of the other scope-related SyntaxErrors, so I don't think it's important.

(Again, this is not an error people are likely to make unless they are *looking* for edge cases of the walrus operator.)

--
--Guido van Rossum (python.org/~guido)
Pronouns: he/him/his (why is my pronoun here?)