Hello,

The following code prints only 'init x'. Never 'del x'. What is
happening? How can one actually delete an object that inherits from
gobject? The code works ok, if you change the parent class of x to just
object or something else. Calling sys.getrefcount(ob) just before the
del-statement returns 3.

Juho Vuori



import gobject

class x(gobject.GObject):
    def __init__(self):
        super(x,self).__init__()
        print 'init x'

    def __del__(self):
        print 'del x'
        super(x,self).__del__()

gobject.type_register(x)
ob = x()
del(ob)


_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to