[New-bugs-announce] [issue44456] Improve syntax error for mixing keyword/positional in max patterns

Pablo Galindo Salgado report at bugs.python.org
Fri Jun 18 17:07:47 EDT 2021


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

This got me confused for a sec when doing some live demo:

>>> match x:
...    case A(y=1, foo):
  File "<stdin>", line 2
    case A(y=1, foo):
                   ^
SyntaxError: invalid syntax

I propose to improve this to:

>>> match x:
...    case A(y=1, foo):
  File "<stdin>", line 2
    case A(y=1, foo):
                ^^^
SyntaxError: cannot mix keyword patterns and positional patterns

----------
messages: 396088
nosy: brandtbucher, pablogsal
priority: normal
severity: normal
status: open
title: Improve syntax error for mixing keyword/positional in max patterns

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44456>
_______________________________________


More information about the New-bugs-announce mailing list