Author Jelle Zijlstra
Recipients Jelle Zijlstra
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:20Jelle Zijlstrasetrecipients: + Jelle Zijlstra
2017-01-08 11:29:20Jelle Zijlstrasetmessageid: <1483874960.49.0.58571949289.issue29205@psf.upfronthosting.co.za>
2017-01-08 11:29:20Jelle Zijlstralinkissue29205 messages
2017-01-08 11:29:20Jelle Zijlstracreate