__class__ cell is defined for methods in py3

Bug #1658411 reported by Antony Lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
New
Undecided
Unassigned

Bug Description

On Py3,

class C:
    def ownclass(self):
        return __class__
print(C().ownclass())

executes correctly (`__class__` is the class in which the method was defined, which is not necessarily the type of `self`, see https://www.python.org/dev/peps/pep-3135/#specification). But pyflakes spuriously complains:

/tmp/foo.py:3: undefined name '__class__'

Tags: easy
John Vandenberg (jayvdb)
tags: added: easy
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.