[issue44368] Invalid mapping patterns give confusing SyntaxErrors
Pablo Galindo Salgado
report at bugs.python.org
Wed Jun 9 17:57:52 EDT 2021
Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:
> Could we just try parsing "as _" and raise if so? That wouldn't conflict with any existing rules, and that way we could actually have a helpful error message.
No, the same happens with other targets such as:
File "/home/pablogsal/github/python/master/lel.py", line 2
case 42 as 1+1:
^
SyntaxError: expected ':'
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44368>
_______________________________________
More information about the Python-bugs-list
mailing list