[Python-projects] Bug? : Class 'xxx' has no 'yyy' member
Maarten ter Huurne
maarten at treewalker.org
Sun Apr 5 16:16:10 CEST 2009
On Sunday 05 April 2009, Vincent Legoll wrote:
> $ 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...
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.)
> $ 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 ?
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)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]]
Bye,
Maarten
More information about the Python-Projects
mailing list