codegen
codegen copied to clipboard
Fix incorrect Binary Operation Code Generation
Fixes the following sample code.
import ast
import codegen
import sys
eval(codegen.to_source(ast.parse('sys.stdout.write(("a" + "b")[:1])')))
As this currently eval()'s the following code.
sys.stdout.write('a' + 'b'[:1])
Cheers, Jurriaan