Comment 2 for bug 879945

Revision history for this message
Wilfred Hughes (yatc18ks0-9a-ngeefk4xa) wrote :

The Python AST gives the line number where the function definition starts, which includes the decorator. However, the fault isn't on that line and the user cannot fix the issue by changing that line.

Given a FunctionDef node:

node.lineno # where the function definition starts
node.lineno + len(node.decorator_list) # where the function name is