This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum
Date 2021-05-21.00:34:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org>
In-reply-to
Content
This seems a regression from 3.9.

>>> foo[x = 1
... ]
  File "<stdin>", line 1
    foo[x = 1
        ^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
>>>

Note how the syntax error is in line 1 and yet the REPL asks for more input (the "..." prompt) and doesn't stop until I type "]".

In 3.9 I just get "SyntaxError: invalid syntax" but the REPL doesn't ask for the second line:

>>> foo[x = 1
  File "<stdin>", line 1
    foo[x = 1
          ^
SyntaxError: invalid syntax
>>>
History
Date User Action Args
2021-05-21 00:34:22gvanrossumsetrecipients: + gvanrossum
2021-05-21 00:34:22gvanrossumsetmessageid: <1621557262.74.0.483507293797.issue44201@roundup.psfhosted.org>
2021-05-21 00:34:22gvanrossumlinkissue44201 messages
2021-05-21 00:34:22gvanrossumcreate