The appended script returned: Code: yes yes no and it should be robust. Code: import gobject import gtk myContainer = gtk.Window() if gobject.type_is_a(myContainer,gtk.Window): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Container): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Label): print 'yes' else: print 'no'
yes yes no
import gobject import gtk myContainer = gtk.Window() if gobject.type_is_a(myContainer,gtk.Window): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Container): print 'yes' else: print 'no' if gobject.type_is_a(myContainer,gtk.Label): print 'yes' else: print 'no'