Hi all. Will the following code in Python 3.4 print "Goodbye from B()" and "Goodbye from A():

class A:
    def __init__(self, a):
        self.a = a
        print('In A.__init__()')
    def __del__(self):
        print('Goodbye from A()')

class B:
    def __init__(self):
        self.b = A(self) # Reference cycle
        print('In B.__init__()')
    def __del__(self):
        print('Goodbye from B()')

b = B()
del b

Regards, Marco

--
Marco Buttu
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to