[issue30497] Line number of docstring in AST

STINNER Victor report at bugs.python.org
Mon May 29 06:32:50 EDT 2017


STINNER Victor added the comment:

> We use this feature in pyflakes (https://github.com/PyCQA/pyflakes/issues/271)

AST is not designed to be 1-to-1 .py source to AST mapping. If you need the exact line number, you might use your own parser. I don't know what is using pylint for example? There is also https://github.com/PyCQA/redbaron which provides such 1-to-1 mapping but it has a different API than AST.

Sadly, I suggest to close this issue as WONTFIX.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30497>
_______________________________________


More information about the Python-bugs-list mailing list