On Thu, Oct 22, 2020 at 10:42 AM MRAB <pyt...@mrabarnett.plus.com> wrote:
> [Guido] > > - SyntaxError if an irrefutable case[1] is followed by another case > block. > > - SyntaxError if an irrefutable pattern[1] occurs on the left of '|', > > e.g. 'x | [x]'. > > Is "syntax error" that the right term for it? Maybe it should be > something different, a subclass of SyntaxError perhaps. > I think it is a SyntaxError. It is detected without needing to look at the symbol table, although it is not encoded in the grammar (we probably could, but it would be very tedious), so it's done during a later stage. We have many of these (e.g. 'return' outside function, also not encoded in the grammar). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HUKF5GSFHPOB7R7ZPUJY3D6VEQDW45CQ/ Code of Conduct: http://python.org/psf/codeofconduct/