Garbage collection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Pickles

    Garbage collection

    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.



Working...