Closed ikamensh closed 4 years ago
Astor wraps expressions into parenthesis, also when this is completely redundant:
code = '''print(f"{var + 1:.2f}")''' import ast tree = ast.parse(code) import astor recovered = astor.to_source(tree) print('original: ',code) print('astor: ',recovered)
output:
original: print(f"{var + 1:.2f}") astor: print(f'{(var + 1):.2f}')
Python: 3.6.8 astor: 0.8.0
Just saw, preparing patch (sorry for delay).
Astor wraps expressions into parenthesis, also when this is completely redundant:
output:
Python: 3.6.8 astor: 0.8.0