New submission from Guido van Rossum <[email protected]>:
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
>>>
----------
messages: 394087
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: REPL requests another line despite syntax error
type: compile error
versions: Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com