• Home
  • Raw
  • Download

Lines Matching refs:references

1 :mod:`weakref` --- Weak references
5 :synopsis: Support for weak references and weak dictionaries.
17 references` to objects.
26 only remaining references to a referent are weak references,
29 reference may return the object even if there are no strong references to it.
31 A primary use for weak references is to implement caches or
40 the :mod:`weakref` module are an alternative, using weak references to construct
43 :class:`WeakValueDictionary`, then when the last remaining references to that
44 image object are the weak references held by weak mappings, garbage collection
48 :class:`WeakKeyDictionary` and :class:`WeakValueDictionary` use weak references
49 in their implementation, setting up callback functions on the weak references
52 but keeps weak references to its elements, just like a
63 create your own weak references directly. The low-level machinery is
76 support weak references but can add support through subclassing::
86 references even when subclassed.
88 Extension types can easily be made to support weak references; see
102 It is allowable for many weak references to be constructed for the same object.
110 Weak references are :term:`hashable` if the *object* is hashable. They will
115 Weak references support tests for equality, but not ordering. If the referents
116 are still alive, two references have the same equality relationship as their
118 the references are equal only if the reference objects are the same object.
150 Return the number of weak references and proxies which refer to *object*.
160 Mapping class that references keys weakly. Entries in the dictionary will be
170 exposes the internal references directly. The references are not guaranteed to
171 be "live" at the time they are used, so the result of calling the references
173 references that will cause the garbage collector to keep the keys around longer
179 Return an iterable of the weak references to the keys.
184 Mapping class that references values weakly. Entries in the dictionary will be
197 Return an iterable of the weak references to the values.
202 Set class that keeps weak references to its elements. An element will be
291 not own any references to *obj*, either directly or indirectly,
300 The type object for weak references objects.
530 A more robust alternative can be to define a finalizer which only references