Message251522
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.value
>>> print("col_offset of call expression:", call.col_offset)
col_offset of call expression: 0
>>> print("col_offset of func of the call:", call.func.col_offset)
col_offset of func of the call: 0
>>> 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)
col_offset of call expression: 1
>>> print("col_offset of func of the call:", call.func.col_offset)
col_offset of func of the call: 1
>>> print("lineno of call expression:", call.lineno)
lineno of call expression: 1
>>> print("lineno of func of the call:", call.lineno)
lineno of func of the call: 1 |
|
Date |
User |
Action |
Args |
2015-09-24 13:35:33 | rnovacek | set | recipients:
+ rnovacek, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, flox, Mark.Shannon, scummos, python-dev, Aivar.Annamaa |
2015-09-24 13:35:33 | rnovacek | set | messageid: <1443101733.1.0.239815446079.issue21295@psf.upfronthosting.co.za> |
2015-09-24 13:35:33 | rnovacek | link | issue21295 messages |
2015-09-24 13:35:32 | rnovacek | create | |
|