Message368936
The new PEG parser fails when a parenthesised expression with a single child (a group) contains a starred expression. Example:
╰─ ./python.exe
Python 3.9.0a6+ (heads/master-dirty:4a12d12186, May 15 2020, 14:53:45)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.parse('(*a)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/lysnikolaou/Repositories/cpython/Lib/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
(*a)
^
SyntaxError: invalid syntax
This was valid syntax up until now:
╰─ ./python.exe -X oldparser
Python 3.9.0a6+ (heads/master-dirty:4a12d12186, May 15 2020, 14:53:45)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.dump(ast.parse('(*a)'))
"Module(body=[Expr(value=Starred(value=Name(id='a', ctx=Load()), ctx=Load()))], type_ignores=[])" |
|
Date |
User |
Action |
Args |
2020-05-15 12:04:27 | lys.nikolaou | set | recipients:
+ lys.nikolaou, gvanrossum, pablogsal |
2020-05-15 12:04:27 | lys.nikolaou | set | messageid: <1589544267.84.0.231872596395.issue40631@roundup.psfhosted.org> |
2020-05-15 12:04:27 | lys.nikolaou | link | issue40631 messages |
2020-05-15 12:04:27 | lys.nikolaou | create | |
|