Message370620
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". |
|
Date |
User |
Action |
Args |
2020-06-02 19:08:16 | adamwill | set | recipients:
+ adamwill |
2020-06-02 19:08:16 | adamwill | set | messageid: <1591124896.73.0.969808465521.issue40848@roundup.psfhosted.org> |
2020-06-02 19:08:16 | adamwill | link | issue40848 messages |
2020-06-02 19:08:16 | adamwill | create | |
|