f821 reports __module__ as undefined
Bug #1648651 reported by
John Reese
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Undecided
|
Unassigned |
Bug Description
pyflakes reports F821 for "undefined name '__module__'", which is part of a set of available builtins: https:/
Code to reproduce: https:/
Running `pyflakes foo.py` generates F821 for the above code, but this value should be not be considered undefined.
To post a comment you must log in.
Python docs are confusing here. They say
> Special attributes: __name__ is the class name; __module__ is the module name in which the class was defined; __dict__ is the dictionary containing the class’s namespace; __bases__ is a tuple (possibly empty or a singleton) containing the base classes, in the order of their occurrence in the base class list; __doc__ is the class’s documentation string, or None if undefined.
but __dict__ and __bases__ are undefined in the class body (pyflakes seems to be correct for all except for __module__).