New submission from Brandt Bucher <brandtbuc...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue44368>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to