PyDocs

Data Types

weakref

Weak reference support for Python.

This module is an implementation of PEP 205:

https://peps.python.org/pep-0205/
Symbols in weakref

c

CallableProxyType
The type object for proxies of callable objects.

f

finalize
Class for finalization of weakrefable objects

g

getweakrefcount
Return the number of weak references to 'object'.
getweakrefs
Return a list of all weak reference objects pointing to 'object'.

p

proxy
Create a proxy object that weakly references 'object'.
ProxyType
The type object for proxies of objects which are not callable.
ProxyTypes
Sequence containing all the type objects for proxies.

r

ref
Return a weak reference to object.
ReferenceType
The type object for weak references objects.

w

WeakKeyDictionary
Mapping class that references keys weakly.
WeakMethod
A custom `weakref.ref` subclass which simulates a weak reference to a bound method, working around the lifetime problem of bound methods.
WeakSet
Set class that keeps weak references to its elements.
WeakValueDictionary
Mapping class that references values weakly.