Weakref utils for compatibility between Python 2 and Python 3 or for extended features.
Returns a weak reference to object. The original object can be retrieved by calling the reference object if the referent is still alive. If the referent is no longer alive, calling the reference object will cause None to be returned.
The signature is the same as the standard weakref library, but it returns WeakMethod if the object is a bound method.
Parameters: |
|
---|---|
Returns: | A weak reference to the object |
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.
The signature is the same as the standard weakref library, but it returns WeakMethodProxy if the object is a bound method.
Parameters: |
|
---|---|
Returns: | A proxy to a weak reference of the object |
Wraps a callable object like a function or a bound method. Feature callback when the object is about to be finalized. Provids the same interface as a normal weak reference.
Wraps a callable object like a function or a bound method with a weakref proxy.