
On Thu, Oct 22, 2020 at 10:42 AM MRAB <python@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-c...>