Message384246
Seems that I also found this weird behaviour in the old parser:
import ast
code = """\
x = (
'PERL_MM_OPT', (
f'wat'
f'INSTALL-BASE={shlex.quote(venv)} '
f'wat'
),
)
"""
elem = ast.parse(code).body[0].value.elts[1].values[1].value
print(elem)
print(code.split("\n")[elem.lineno-1][elem.col_offset:elem.end_col_offset])
In Python3.8 this prints:
<_ast.Call object at 0x7f7484393a00>
'wat'
which is wrong as the code for that call is certainly not "wat". This happens in the oldparser in 3.9:
❯ ../3.9/python -Xoldparser lel.py
<ast.Call object at 0x7f78afbc1e10>
'wat'
And something wrong happens in the current master with the new parser:
❯ ../3.9/python lel.py
<ast.Call object at 0x7f504e9a1eb0>
STALL-BASE={shlex
But with PR24067:
<ast.Call object at 0x7fec78673fa0>
shlex.quote(venv) |
|
Date |
User |
Action |
Args |
2021-01-03 00:19:23 | pablogsal | set | recipients:
+ pablogsal, gvanrossum, Anthony Sottile, lys.nikolaou |
2021-01-03 00:19:23 | pablogsal | set | messageid: <1609633163.51.0.552592806521.issue42806@roundup.psfhosted.org> |
2021-01-03 00:19:23 | pablogsal | link | issue42806 messages |
2021-01-03 00:19:23 | pablogsal | create | |
|