>> >>> l
    >> [<Button object (GtkButton) at 0x8293134>, <Button object (GtkButton) at 
0x8296ac4>, <Button object (GtkButton) at 0x8397fb4>]
    >> >>> b = l[0]
    >> >>> b in l
    >> Traceback (most recent call last):
    >>   File "<stdin>", line 1, in ?
    >> TypeError: Button.__cmp__(x,y) requires y to be a 'Button', not a 'instance'

A brief conversation with Guido cleared up what was happening.  In my class
hierarchy I didn't implement __cmp__, but I did implement __getattr__, which
was delegating most things to the underlying Gtk widget, so 

    b.__cmp__(l)

became

    b._real_widget.__cmp(l)

which then barfed.

Writing a __cmp__ method that does the right thing cleared up the problem.

Skip
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to