This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients JelleZijlstra
Date 2017-01-08.11:29:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483874960.49.0.58571949289.issue29205@psf.upfronthosting.co.za>
In-reply-to
Content
The col_offset attribute for ast.AsyncFunctionDef objects points to the "def" keyword, not to the "async" keyword that actually starts the node.

Test case:

In [18]: code = 'async def f(): pass'

In [19]: tree = ast.parse(code)

In [20]: tree.body[0]
Out[20]: <_ast.AsyncFunctionDef at 0x7f5cb6a58f60>

In [21]: tree.body[0].col_offset
Out[21]: 6
History
Date User Action Args
2017-01-08 11:29:20JelleZijlstrasetrecipients: + JelleZijlstra
2017-01-08 11:29:20JelleZijlstrasetmessageid: <1483874960.49.0.58571949289.issue29205@psf.upfronthosting.co.za>
2017-01-08 11:29:20JelleZijlstralinkissue29205 messages
2017-01-08 11:29:20JelleZijlstracreate