[New-bugs-announce] [issue44368] Invalid mapping patterns give confusing SyntaxErrors
Brandt Bucher
report at bugs.python.org
Wed Jun 9 15:47:35 EDT 2021
New submission from Brandt Bucher <brandtbucher at gmail.com>:
Here are a few that I found. Not sure when they were introduced:
match ...:
case {**rest, "key": value}:
pass
match ...:
case {"first": first, **rest, "last": last}:
pass
match ...:
case {**_}:
pass
These all give the following error while parsing the second line:
File "<stdin>", line 1
match ...:
^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
----------
components: Parser
messages: 395453
nosy: brandtbucher, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Invalid mapping patterns give confusing SyntaxErrors
type: behavior
versions: Python 3.11
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44368>
_______________________________________
More information about the New-bugs-announce
mailing list