Skip to content

Commit 0990191

Browse files
committed
gh-150553: Document object.__weakref__
1 parent 9e863fa commit 0990191

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Doc/reference/datamodel.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,20 @@ Attribute lookup speed can be significantly improved as well.
26462646
and *__weakref__* for each instance.
26472647

26482648

2649+
.. attribute:: object.__weakref__
2650+
2651+
A descriptor added by the implementation to some classes whose instances
2652+
support weak references.
2653+
2654+
This attribute is either ``None`` or a weak reference or proxy object
2655+
associated with the instance. Use :func:`weakref.getweakrefs` to retrieve
2656+
all weak references and proxy objects that refer to an object.
2657+
2658+
2659+
.. impl-detail::
2660+
This attribute may not exist in all Python implementations.
2661+
2662+
26492663
.. _datamodel-note-slots:
26502664

26512665
Notes on using *__slots__*:

0 commit comments

Comments
 (0)