Jelle Zijlstra added the comment: 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 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29205> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com