Simon Pickles <[EMAIL PROTECTED]> writes:

> Ken wrote:
>> What is your __del__ method doing?
>>   
> Actually, nothing but printing a message when the object is deleted,
> just morbid curiosity.
>
> I've yet to see one of the destructor messages, tho....

Do your objects participate in reference cycles?  In that case they
are deallocated by the cycle collector, and the cycle collector
doesn't invoke __del__.

>>> class X(object):
...   def __del__(self): print "gone"
...
>>> a = X()
>>> a = 1
gone
>>> b = X()
>>> b.someslot = b
>>> b = 1
>>> import gc
>>> gc.collect()
0
>>> 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to