Skip to content

gh-150553: Document object.__weakref__#151581

Open
zainnadeem786 wants to merge 1 commit into
python:mainfrom
zainnadeem786:gh-150553-document-weakref
Open

gh-150553: Document object.__weakref__#151581
zainnadeem786 wants to merge 1 commit into
python:mainfrom
zainnadeem786:gh-150553-document-weakref

Conversation

@zainnadeem786

@zainnadeem786 zainnadeem786 commented Jun 17, 2026

Copy link
Copy Markdown

Document the public behavior of object.__weakref__ in the data model reference.

The new entry explains that __weakref__ is an implementation-provided descriptor for instances that support weak references, and that accessing it returns either None or a weak reference-related object associated with the instance.

The documentation also clarifies that __weakref__ is not a complete list of all weak references and directs users to weakref.getweakrefs() when they need all weak references and proxies associated with an object.

No runtime behavior or C implementation is changed.

@read-the-docs-community

read-the-docs-community Bot commented Jun 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33182902 | 📁 Comparing 0453f56 against main (9e863fa)

  🔍 Preview build  

2 files changed
± reference/datamodel.html
± whatsnew/changelog.html

Comment thread Doc/reference/datamodel.rst
Comment thread Doc/reference/datamodel.rst Outdated
Comment thread Doc/reference/datamodel.rst Outdated
@zainnadeem786 zainnadeem786 force-pushed the gh-150553-document-weakref branch from b7d68c8 to 0990191 Compare June 17, 2026 12:58
@zainnadeem786 zainnadeem786 force-pushed the gh-150553-document-weakref branch from 0990191 to 0453f56 Compare June 17, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants