property decorator -> redefinition of function

Bug #812958 reported by Cassapanco di Mogano
82
This bug affects 17 people
Affects Status Importance Assigned to Milestone
Pyflakes
Fix Released
Low
Unassigned

Bug Description

Code from: http://docs.python.org/library/functions.html#property

-------------------------------------- foo.py

class C(object):
    def __init__(self):
        self._x = None

    @property
    def x(self):
        """I'm the 'x' property."""
        return self._x

    @x.setter
    def x(self, value):
        self._x = value

    @x.deleter
    def x(self):
        del self._x

---------------------------------------------

pyflakes output is

$ pyflakes foo.py
foo.py:11: redefinition of function 'x' from line 6
foo.py:15: redefinition of function 'x' from line 11

description: updated
Revision history for this message
Kamil Páral (kamil.paral) wrote :

I can confirm this problem.

Changed in pyflakes:
status: New → Confirmed
Revision history for this message
Kamil Kisiel (kisielk) wrote :

There's a patch in a pending pull request on the kevinw/pyflakes fork on github that addresses this issue:

https://github.com/ervandew/pyflakes/commit/b971f2775500b4154619dc5d71ba77fc7e4efdf6

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

The feature seems questionable to me. However, it would be easier to evaluate the implementation if there were unit tests for the change.

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

It looks like this was fixed - inadvertently perhaps? - by <http://bazaar.launchpad.net/~divmod-dev/divmod.org/trunk/revision/2685>.

Changed in pyflakes:
status: Confirmed → Fix Committed
Revision history for this message
MestreLion (mestrelion) wrote :

Any news on when this fix will be released in Ubuntu?

Florent (florent.x)
Changed in pyflakes:
importance: Undecided → Low
milestone: none → 0.6.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.