[issue33211] lineno and col_offset are wrong on function definitions with decorators

Ethan Smith report at bugs.python.org
Tue Apr 3 18:35:18 EDT 2018


Ethan Smith <ethan at ethanhs.me> added the comment:

There is also a relevant mypy bug report https://github.com/python/mypy/issues/3871. This seems like a common problem for tools working on the AST. The relevant code seems to be https://github.com/python/cpython/blob/master/Python/ast.c#L1695. 

Would a possible solution be adding a decorated_lineno attribute to decorated ast nodes?

----------
nosy: +Ethan Smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33211>
_______________________________________


More information about the Python-bugs-list mailing list