New submission from Andre Roberge <andre.robe...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue46004>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to