On this page
weakref.getweakrefs
Prev: weakref.getweakrefcount | Up: weakref | Next: weakref.proxy
Rel: weakref.CallableProxyType, weakref.finalize, weakref.getweakrefcount, weakref.proxy
Ref: docs.python.org — weakref.getweakrefs
Tags: #public #python3 #stdlib #weakref
Import
import weakref
from weakref import getweakrefs
Signature & Overview
weakref.getweakrefs(object, /)
Return a list of all weak reference objects pointing to 'object'.
Usage
import weakref
class Box: pass
b = Box()
r = weakref.ref(b)
assert weakref.getweakrefs(b) == [r]
Gotchas
- Returns a list of all weakref/proxy objects referencing
obj.
REPL Inspect
from weakref import getweakrefs
help(getweakrefs)
Linked from
- tuts/python3/stdlib_module/weakref
- tuts/python3/stdlib_module/weakref/CallableProxyType
- tuts/python3/stdlib_module/weakref/finalize
- tuts/python3/stdlib_module/weakref/getweakrefcount
- tuts/python3/stdlib_module/weakref/proxy
- tuts/python3/stdlib_module/weakref/ProxyType
- tuts/python3/stdlib_module/weakref/ref
- tuts/python3/stdlib_module/weakref/ReferenceType
- tuts/python3/stdlib_module/weakref/WeakKeyDictionary
- tuts/python3/stdlib_module/weakref/WeakMethod
- tuts/python3/stdlib_module/weakref/WeakSet
- tuts/python3/stdlib_module/weakref/WeakValueDictionary
Related notes
- tuts/python3/stdlib_module/weakref/CallableProxyType Linked here; links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/finalize Linked here; links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/getweakrefcount Linked here; links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/proxy Linked here; links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/weakref/ProxyType links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/ref links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/ReferenceType links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/WeakKeyDictionary links to this page; shared tags: #stdlib, #weakref
- tuts/python3/stdlib_module/weakref/WeakMethod links to this page; shared tags: #stdlib, #weakref