I’m refactoring some old stuff and moving a lot of previously node-based stuff into pure python. I was going to use a DependableDict to store some class instances, but it looks like __del__() doesn’t get called on instances when .clear() is called on the containing DependableDict.
In general, it’s not great practice to rely on __del__ because it’s invoked by the garbage collector, whose timing is not guaranteed. If possible, it’s recommended to use the context manager.
Still, I can check this out if you’d like to send a simple example of what you’re trying to do. Post here or send to ivan@derivative.ca