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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33177425 | 📁 Comparing 7836891 against main (9e863fa)

  🔍 Preview build  

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

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.

1 participant