Message284981
The col_offset is actually correct when there is a decorator:
In [26]: code = '@decorator\nasync def f(): pass'
In [27]: tree = ast.parse(code)
In [28]: tree.body[0].col_offset
Out[28]: 0
The same issue appears with async for and async with:
In [31]: code = '@decorator\nasync def f():\n async for x in y: pass'
In [32]: tree = ast.parse(code)
In [34]: tree.body[0].body[0]
Out[34]: <_ast.AsyncFor at 0x7f5cb6a77198>
In [35]: tree.body[0].body[0].col_offset
Out[35]: 10 |
|
Date |
User |
Action |
Args |
2017-01-08 11:35:30 | JelleZijlstra | set | recipients:
+ JelleZijlstra |
2017-01-08 11:35:30 | JelleZijlstra | set | messageid: <1483875330.77.0.796018892084.issue29205@psf.upfronthosting.co.za> |
2017-01-08 11:35:30 | JelleZijlstra | link | issue29205 messages |
2017-01-08 11:35:30 | JelleZijlstra | create | |
|