berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
803 stars 102 forks source link

Python3.8 f-string debugging #138

Closed isidentical closed 5 years ago

isidentical commented 5 years ago

Astor doesn't supports bpo-36817 (f-string debugging syntax)

>>> ast.dump(ast.parse("f'{x=}'"))
"Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114, format_spec=None, expr_text='x=')]))], type_ignores=[])"
>>> astor.to_source(ast.parse("f'{x=}'"))
'f"""{x!r}"""\n'