Skip to content

gh-110891: Document PyType_GetDict() as returning a new reference - #162107

Merged
ZeroIntensity merged 1 commit into
python:mainfrom
kirtiagwl1595:gh-110891-pytype-getdict-refcount
Nov 16, 2026
Merged

ZeroIntensity merged 1 commit into
python:mainfrom
kirtiagwl1595:gh-110891-pytype-getdict-refcount

Conversation

@kirtiagwl1595

Copy link
Copy Markdown
Contributor

PyType_GetDict() returns a new reference (it calls _Py_XNewRef()), but its documentation does not say so. Similar functions such as PyType_GetName() show "Return value: New reference." because they are listed in Doc/data/refcounts.dat. This adds the missing entry, so readers know they must call Py_DECREF() on the result, which is the change the reporter asked for.

This needs the skip news label (docs only).

I used Claude Code to research and draft this change; I reviewed every line.

@bedevere-app

bedevere-app Bot commented Nov 16, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35925307 | 📁 Comparing 6028e7b against main (585755d)

  🔍 Preview build  

1 file changed
± c-api/type.html

@ZeroIntensity ZeroIntensity added docs Documentation in the Doc dir skip news needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 16, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Nov 16, 2026
@ZeroIntensity
ZeroIntensity merged commit 910a92b into python:main Nov 16, 2026
45 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 16, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @kirtiagwl1595 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 16, 2026

Copy link
Copy Markdown

GH-162133 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 16, 2026
@bedevere-app

bedevere-app Bot commented Nov 16, 2026

Copy link
Copy Markdown

GH-162134 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 16, 2026
ZeroIntensity pushed a commit that referenced this pull request Nov 16, 2026
…nce (GH-162107) (GH-162134)

(cherry picked from commit 910a92b)

Co-authored-by: Kirti Aggarwal <47375858+kirtiagwl1595@users.noreply.github.com>
ZeroIntensity pushed a commit that referenced this pull request Nov 16, 2026
…nce (GH-162107) (GH-162133)

(cherry picked from commit 910a92b)

Co-authored-by: Kirti Aggarwal <47375858+kirtiagwl1595@users.noreply.github.com>
@kirtiagwl1595
kirtiagwl1595 deleted the gh-110891-pytype-getdict-refcount branch November 17, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants