Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Incorrect line numbers when using function decorators #16

@Wilfred

Description

@Wilfred
def decorator(func):
    return func


@decorator
def defined_twice():
    pass


@decorator
def defined_twice():
    pass

Calling pyflakes on this:

> pyflakes twice.py 
twice.py:10: redefinition of function 'defined_twice' from line 5

Expected it to refer to the function definition, on line 6 and redefined on line 11. The problem is the function name, not the decorator usage so referring to lines 6 and 11 seems more logical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions