[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Radek Novacek
Radek Novacek added the comment: There is still problem with col_offset is some situations, for example col_offset of the ast.Attribute should be 4 but is 0 instead: >>> for x in ast.walk(ast.parse('foo.bar')): ... if hasattr(x, 'col_offset'): ... print("%s: %d"

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-10-06 Thread Radek Novacek
Radek Novacek added the comment: Aivar, I have to admit that my knowledge of this is limited, but as I understand it, the attribute is "bar" in the "foo.bar" expression. I can get beginning of the assignment by >>> ast.parse('foo.bar').body[0].value.value.co

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-09-24 Thread Radek Novacek
Radek Novacek added the comment: I've ran the tests from first and second comment using python 3.5.0 and it seems it produces correct results: >>> import ast >>> tree = ast.parse("sin(0.5)") >>> first_stmt = tree.body[0] >>> call = first_stmt.