From 0453f56dafd4780a8ad301421e11917af5177e07 Mon Sep 17 00:00:00 2001 From: "zainnadeem(RedOpsCell)" Date: Wed, 17 Jun 2026 17:58:00 +0500 Subject: [PATCH] gh-150553: Document object.__weakref__ --- Doc/reference/datamodel.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 2a961a062780f46..01b2cd1caa1fe16 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -2646,6 +2646,19 @@ Attribute lookup speed can be significantly improved as well. and *__weakref__* for each instance. +.. attribute:: object.__weakref__ + + A descriptor added by the implementation to some classes whose instances + support weak references. + + This attribute is either ``None`` or a weak reference or proxy object + associated with the instance. Use :func:`weakref.getweakrefs` to retrieve + all weak references and proxy objects that refer to an object. + .. impl-detail:: + + This attribute may not exist in all Python implementations. + + .. _datamodel-note-slots: Notes on using *__slots__*: