The weakref module allows the Python programmer to create weak references to objects. Return a weak reference to object . The original object can be retrieved by calling the reference object, if the referent is still alive. It is allowable for many weak references to be constructed for the same object. Callbacks registered for each weak reference will be called from the most recently registered callback to the oldest registered callback.
Weak references are hashable if the object is hashable.
They will maintain their hash value even after the object was deleted. Weak references support test for equality, but not ordering. If the object has been deleted, they are equal iff they are identical. Return a proxy to object which uses a weak reference. This supports use of the proxy in most contexts instead of requiring the explicit dereferencing used with weak reference objects.