python-ast-explorer
python-ast-explorer copied to clipboard
Very nice, but I see a problem
print(astor.dump_tree(ast.parse('5*c * (-1 + d)', mode='eval')))
is
Expression(
body=BinOp(left=BinOp(left=Num(n=5), op=Mult, right=Name(id='c')),
op=Mult,
right=BinOp(left=UnaryOp(op=USub, operand=Num(n=1)), op=Add, right=Name(id='d'))))
but I don't see the UnaryOp
at https://python-ast-explorer.com
.