'PEP 442 finalizer.  Record that this was called, check the
object is in a sane state, and invoke a side effect.'

def __del__(self):

    try:
        if (not self._cleaning):
            self.del_calls.append(id(self))
            self.check_sanity()
            self.side_effect()
    except Exception as e:
        self.errors.append(e)
