Open
Description
Operator precedence is not being properly handled. A couple of examples:
>>> to_ast = lambda x:ast.parse(x, mode='eval')
>>> codegen.to_source(to_ast( '(1+2)*3' ))
'1 + 2 * 3'
1+2*3
= 7
. (1+2)*3
= 9
>>> codegen.to_source(to_ast( '( "%s " % (sep,) ).join(foo)' ))
"'%s ' % (sep,).join(foo)"
This is evaluated as '%s ' % ((sep,).join(foo))
because .
is higher precedence than %
Metadata
Metadata
Assignees
Labels
No labels