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

Incorrect line numbers when using function decorators #16

Open
Wilfred opened this issue Apr 22, 2011 · 0 comments
Open

Incorrect line numbers when using function decorators #16

Wilfred opened this issue Apr 22, 2011 · 0 comments

Comments

@Wilfred
Copy link

Wilfred commented Apr 22, 2011

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant