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

Aivar Annamaa report at bugs.python.org
Fri Apr 18 12:58:03 CEST 2014


Aivar Annamaa added the comment:

... also, lineno is wrong for both Call and call's func, when func and arguments are on different lines:

import ast
tree = ast.parse("(sin\n(0.5))")
first_stmt = tree.body[0]
call = first_stmt.value
print("col_offset of call expression:", call.col_offset)
print("col_offset of func of the call:", call.func.col_offset)
print("lineno of call expression:", call.lineno)
print("lineno of func of the call:", call.lineno)

# lineno-s should be 1 for both call and func

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21295>
_______________________________________


More information about the Python-bugs-list mailing list