pylint #8881 class member detection false positive [open]
Vincent reported on python-projects :
"""Test for pylint gtk.VBox bug""" import gtk DIAL = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, "") VB = DIAL.vbox # VB = gtk.VBox() VB.set_spacing(12) print "set_spacing" in dir(VB) print getattr(VB, "set_spacing")
$ pylint t.py No config file found, using default configuration ************* Module t E: 12: Class 'vbox' has no 'set_spacing' member
Change VB to not come from MessageDialog().vbox by uncommenting the "VB = gtk.VBox()" line and all is good...
Same problem happens with gtk.Style's "font_desc" attribute or gtk.Image's set_alignment(), set_padding(), gtk.Label's set_use_markup() methods.
The strange thing is that it says 'vbox' in the error message, not 'VBox', which is the actual class name. I don't know if this is a hint towards the cause of the problem or an unrelated bug in the E1101 check or astng.
(I checked and "DIAL.vbox.__class__ is gtk.VBox" returns True, so it is really the same class.)
The same problem also occurs on the version that I have installed, which is up to date as far as I know
pylint 0.18.0, astng 0.19.0, common 0.39.0 Python 2.6 (r26:66714, Feb 3 2009, 20:49:49)
|done in||<not specified>|
|closed by||<not specified>|
- logilab-astng #4294 E1102 false positive (not callable)
- logilab-astng #9515 strange message for non-class "Class baz has no egg member"
- logilab-astng #46273 wrong type inference for subprocess.Popen(...).communicate(...)
- logilab-astng #3158 use logging to allow pylint to get (at least) inference error information
- pylint #4288 message [en|dis]abling refactoring