[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:49:40 CEST 2014


New submission from Aivar Annamaa:

Following program gives correct result in Python versions older than 3.4, but incorrect result in 3.4:

----------------------
import ast
tree = ast.parse("sin(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)
-----------------------

it should print:
col_offset of call expression: 0
col_offset of func of the call: 0

but in 3.4 it prints:
col_offset of call expression: 3
col_offset of func of the call: 0

----------
components: Interpreter Core
files: py34_ast_call_bug.py
messages: 216777
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse
versions: Python 3.4
Added file: http://bugs.python.org/file34962/py34_ast_call_bug.py

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


More information about the Python-bugs-list mailing list