FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141004: Document `PyDict_GET_SIZE` by ZeroIntensity · Pull Request #141078 · python/cpython · GitHub

/ cpython Public

gh-141004: Document PyDict_GET_SIZE - #141078

Merged
ZeroIntensity merged 1 commit into
python:mainfrom
ZeroIntensity:document-pydict-get-size
Nov 5, 2025
Merged

gh-141004: Document PyDict_GET_SIZE#141078
ZeroIntensity merged 1 commit into
python:mainfrom
ZeroIntensity:document-pydict-get-size

Conversation

ZeroIntensity commented Nov 5, 2025
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

StanFromIreland left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Tangent: I must say it is a curious duplication (albeit demoting checks to an assert(PyDict_Check(op));), but I did not look much into it, there may be some good reasoning. Although it seems like something that should be deprecated.

ZeroIntensity commented Nov 5, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

We have similar variations for other APIs, such as PyList_GET_SIZE and PyTuple_GET_SIZE. When you're certain that the object is of the correct type, it's faster to use these. PyDict_GET_SIZE seems to be used in quite a few third-party packages, so I'm opposed to deprecating it.

Thanks for the review!

ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Nov 5, 2025
ZeroIntensity merged commit f0ab07f into python:main Nov 5, 2025
39 checks passed
ZeroIntensity deleted the document-pydict-get-size branch November 5, 2025 22:32
github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 5, 2025

Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 5, 2025
(cherry picked from commit f0ab07f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

bedevere-app Bot commented Nov 5, 2025

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 5, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 5, 2025
(cherry picked from commit f0ab07f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

bedevere-app Bot commented Nov 5, 2025

Copy link
Copy Markdown

GH-141083 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Nov 5, 2025
ZeroIntensity added a commit that referenced this pull request Nov 5, 2025
gh-141004: Document `PyDict_GET_SIZE` (GH-141078)
(cherry picked from commit f0ab07f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity added a commit that referenced this pull request Nov 5, 2025
gh-141004: Document `PyDict_GET_SIZE` (GH-141078)
(cherry picked from commit f0ab07f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL