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
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 decorator_ list) # where the function name is
node.lineno + len(node.