I want to have a dict mapping from active frame (FrameType) objects to some data. Active meaning that it is in the current execution stack trace. However, holding a reference to the frame object is not a good idea because that would also keep inactive frames and that will blow up the memory very soon because of all the references
Tag: weak-references
How to access captured arguments / closure of python instance method objects?
The idea is to implement the Observer pattern in a non leaking / autocleanup fashion. Therefor the instance method objects should be removed when the the associated object is cleaned up by the gc. My original idea was to only store weak references to the instance method objects with a finalizer to call a cleanup routine. However as it turns