codegen icon indicating copy to clipboard operation
codegen copied to clipboard

Fix incorrect Binary Operation Code Generation

Open jbremer opened this issue 12 years ago • 0 comments

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

jbremer avatar Apr 08 '13 14:04 jbremer