← Back to team overview

divmod-dev team mailing list archive

[Bug 879945] Re: Incorrect line numbers for decorated functions

 

Why?  The Python AST makes the decision that the first line of a
function is the first decorator that applies to it.  Pyflakes just
propagates this information.

-- 
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Pyflakes.
https://bugs.launchpad.net/bugs/879945

Title:
  Incorrect line numbers for decorated functions

Status in Pyflakes:
  New

Bug description:
  In the code:

  def decorator(func):
      return func

  
  @decorator
  def defined_twice():
      pass

  
  @decorator
  def defined_twice():
      pass

  Pyflakes gives the error: twice.py:10: redefinition of function
  'defined_twice' from line 5

  It ought to be: twice.py:11: redefinition of function 'defined_twice'
  from line 6

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/879945/+subscriptions


References