[Python-apps-team] Bug#534682: pylint: very strange error for non-class "Class baz has no egg member"

Helmut Grohne helmut at subdivi.de
Fri Jun 26 10:21:49 UTC 2009


Package: pylint
Version: 0.18.0-1
Severity: normal

$ cat foo.py
def foo(self, bar):
    def baz():
        pass
    def qux():
        return baz
    spam = bar(None, qux)
    spam.egg()
$ pylint foo.py

************* Module foo
C:  1: Black listed name "foo"
C:  1: Missing docstring
C:  1:foo: Black listed name "foo"
C:  1:foo: Missing docstring
C:  1:foo: Black listed name "bar"
C:  1:foo: Black listed name "bar"
C:  2:foo.baz: Black listed name "baz"
C:  2:foo.baz: Missing docstring
C:  4:foo.qux: Missing docstring
E:  7:foo: Class 'baz' has no 'egg' member
W:  1:foo: Unused argument 'self'

...
$

Sorry, but this is wrong. baz is a function, not a class. Furthermore I
fail to see the connection between spam and baz. Could you explain
and/or fix this?

Helmut





More information about the Python-apps-team mailing list