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 adamwill
Recipients adamwill
Date 2020-06-02.19:08:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591124896.73.0.969808465521.issue40848@roundup.psfhosted.org>
In-reply-to
Content
Not 100% sure this would be considered a bug, but it seems at least worth filing to check. This is a behaviour difference between the new parser and the old one. It's very easy to reproduce:

<mock-chroot> sh-5.0# PYTHONOLDPARSER=1 python3
Python 3.9.0b1 (default, May 29 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from _ast import *
>>> compile("(*starred)", "<unknown>", "exec", flags=PyCF_ONLY_AST)
<ast.Module object at 0x7fe1504532e0>
>>> 
<mock-chroot> sh-5.0# python3
Python 3.9.0b1 (default, May 29 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from _ast import *
>>> compile("(*starred)", "<unknown>", "exec", flags=PyCF_ONLY_AST)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<unknown>", line 1
    (*starred)
              ^
SyntaxError: invalid syntax

That is, you can compile() the expression "(*starred)" with PyCF_ONLY_AST flag set with the old parser, but not with the new one. Without PyCF_ONLY_AST you get a SyntaxError with both parsers, though a with the old parser, the error message is "can't use starred expression here", not "invalid syntax".
History
Date User Action Args
2020-06-02 19:08:16adamwillsetrecipients: + adamwill
2020-06-02 19:08:16adamwillsetmessageid: <1591124896.73.0.969808465521.issue40848@roundup.psfhosted.org>
2020-06-02 19:08:16adamwilllinkissue40848 messages
2020-06-02 19:08:16adamwillcreate