Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Re-apply 0c808db to not raise duplicate function warning for property decorators @prop.setter/deleter. #12

wants to merge 3 commits into from

You still use node.decorators_list here instead of prepared decorators. It fails on Python 2.5...

Fixed... thanks for catching that.


Just got bitten by this bug. Any reason not to accept the pull request?


Hi, is there a reason this pull request is still not merged? It LGTM.


I'd love to see this pulled as well.




Just FYI, this is in florentx/pyflakesand flakey. flakey's API is changing for a few reasons, and I'm going to be adding a couple command-line options to reflect that, so if you want a more traditional version, use @florentx's


my branch is temporary: I'm working with the maintainers of upstream Pyflakes to merge more contributions and make it easier to contribute the patches upstream.
Within few weeks it should be better.


Should be fixed with pyflakes 0.6.1 from PyPI, no?

Else, please open a ticket here:



@anthonyt anthonyt referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2011
  1. @ervandew

    re-apply 0c808db: Don't warn about duplicate functions for property d…

    ervandew authored
    …ecorators @prop.setter and @prop.deleter.
  2. @ervandew
Commits on Mar 17, 2011
  1. @ervandew

    fix typo on retaining python 2.5 compatibility

    ervandew authored
    spotted by xaka
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 8 deletions.
  1. +17 −8 pyflakes/
25 pyflakes/
@@ -98,7 +98,7 @@ class Assignment(Binding):
class FunctionDefinition(Binding):
- pass
+ _property_decorator = False
@@ -353,8 +353,9 @@ def addBinding(self, loc, value, reportRedef=True):
if (isinstance(self.scope.get(, FunctionDefinition)
and isinstance(value, FunctionDefinition)):
- loc,, self.scope[].source)
+ if not value._property_decorator:
+ loc,, self.scope[].source)
if not isinstance(self.scope, ClassScope):
for scope in self.scopeStack[::-1]:
@@ -512,12 +513,20 @@ def NAME(self, node):
def FUNCTIONDEF(self, node):
# the decorators attribute is called decorator_list as of Python 2.6
if hasattr(node, 'decorators'):
- for deco in node.decorators:
- self.handleNode(deco, node)
+ decorators = node.decorators
- for deco in node.decorator_list:
- self.handleNode(deco, node)
- self.addBinding(node, FunctionDefinition(, node))
+ decorators = node.decorator_list
+ for deco in decorators:
+ self.handleNode(deco, node)
+ # Check for property decorator
+ func_def = FunctionDefinition(, node)
+ for decorator in decorators:
+ if getattr(decorator, 'attr', None) in ('setter', 'deleter'):
+ func_def._property_decorator = True
+ self.addBinding(node, func_def)
def LAMBDA(self, node):
Something went wrong with that request. Please try again.