Skip to content

Commit 0453f56

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

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/reference/datamodel.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,19 @@ 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+
.. impl-detail::
2658+
2659+
This attribute may not exist in all Python implementations.
2660+
2661+
26492662
.. _datamodel-note-slots:
26502663

26512664
Notes on using *__slots__*:

0 commit comments

Comments
 (0)