> I've just found out that one of objects is not destroyed when it > should be. This means that something was holding reference to this > object or part of it (i.e. method). Is there any way to check what > holds that reference? I am unable to do that just looking to the code > or debugging it because it is pretty complicated, but I am able to > invoke this situation again. >
I don't think that's possible, since that would mean Python would need to keep a reference to the object holding the reference, which seems pretty awkward. You can however, obtain the number of referencing objects using sys.getrefcount(object). You have to subtract 1 from the result, as the function itself of course holds a reference to at the moment it is being called. Almar
-- http://mail.python.org/mailman/listinfo/python-list