Garbage collection

Simon Pickles sipickles at hotmail.com
Mon Feb 18 22:44:34 CET 2008


Hi,

I'm building a server with python, but coming from a c++ background, 
garbage collection seems strange.

For instance, I have a manager looking after many objects in a dict. 
When those objects are no longer needed, I use del manager[objectid], 
hoping to force the garbage collector to perform the delete.

However, this doesn't trigger my overloaded __del__ destructor. Can I 
simply rely on the python garbage collector to take it from here?

Is there a way to find how many references exist for an object?

Thanks

Simon

-- 
Linux user #458601 - http://counter.li.org.






More information about the Python-list mailing list