Just to be sure: Is it true that __del__ is not called when a variable
is no longer reachable but is related to when it's garbage collected,
which may be later?
I wanted to monitor live instances of certain classes modifying their
__init__ with this wrapper:
from __future__ import nested_scopes
aux = klass.__init__
def __wrapped(self, *arg, **kv):
aux(self, *arg, **kv)
klass.__init__ = __wrapped
Now I would need to detect when they are no longer alive from the point
of view of the execution. Any trick?