[Python-projects] Bug? : Class 'xxx' has no 'yyy' member

Vincent Legoll vincent.legoll at gmail.com
Sun Apr 5 13:50:33 CEST 2009


Is this a known bug in pylint ?

$ cat t.py

#########################################

"""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.

$ pylint --version
No config file found, using default configuration
pylint 0.14.0,
astng 0.17.2, common 0.30.0
Python 2.5.2 (r252:60911, Oct  5 2008, 19:29:17)
[GCC 4.3.2]

Is my pylint too old ?

-- 
Vincent Legoll



More information about the Python-Projects mailing list