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. Maarteen update 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) syt update
| |
priority | important |
---|---|
type | bug |
done in | <not specified> |
load | 0.500 |
load left | 0.500 |
closed by | <not specified> |
Comments
-
2009/11/25 18:06, written by sthenault
add commentthis is because
I've no idea how-to fix this. When building from 'live' object, pylint has no way to find what does this data descriptor refers to...
We could probably build something else than a class (as today, hence the weird message) when a descriptor is encountered so that we get a clearer error message, but I've no better idea.