[New-bugs-announce] [issue46004] Incorrect bad token identified in 3.10.1

Andre Roberge report at bugs.python.org
Tue Dec 7 01:11:16 EST 2021


New submission from Andre Roberge <andre.roberge at gmail.com>:

In Python 3.10.1, a change occurred compared with 3.10.0 so that an incorrect token is flagged for a SyntaxError.  Also, in 3.11.0a2, the suggestion made about having forgotten a comma is incorrect.


Python 3.10.1
    for x range(4):
                  ^
SyntaxError: invalid syntax

(I no longer have 3.10.0 available but I know from my tests that it was identifying correctly the wrong token.)


Python 3.11.0a2
    for x range(4):
        ^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Python 3.9.5
    for x range(4):
          ^
SyntaxError: invalid syntax

Python 3.8.10
    for x range(4):
          ^
SyntaxError: invalid syntax

Python 3.7.8
    for x range(4):
              ^
SyntaxError: invalid syntax

Python 3.6.8
    for x range(4):
              ^
SyntaxError: invalid syntax

----------
components: Parser
messages: 407894
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Incorrect bad token identified in 3.10.1
versions: Python 3.10

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


More information about the New-bugs-announce mailing list