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

gh-141004: Document remaining `pyport.h` utility macros by ZeroIntensity · Pull Request #144279 · python/cpython · GitHub

/ cpython Public

gh-141004: Document remaining pyport.h utility macros - #144279

Merged
ZeroIntensity merged 19 commits into
python:mainfrom
ZeroIntensity:document-more-macros
Feb 4, 2026
Merged

gh-141004: Document remaining pyport.h utility macros#144279
ZeroIntensity merged 19 commits into
python:mainfrom
ZeroIntensity:document-more-macros

Conversation

ZeroIntensity commented Jan 27, 2026
edited
Loading

Copy link
Copy Markdown
Member

Comment thread Doc/c-api/intro.rst Outdated
Comment thread Doc/c-api/intro.rst Outdated
Comment on lines +191 to +192
*type* is the type of the expression. In modern versions of Python, this is
unused. Historically, *type* was used to cast *integer*.

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

Can we reformulate this more precisely through a versionchanged? And indicate that the parameter is unused and kept for backward compatibility?

Copy link
Copy Markdown
Member Author

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

There's already a versionchanged that specifies this below.

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

Oh sorry. In this case, I think we can just say that it's not used anymore and only kept for BC. The change has been done in 3.1 so whatever is after 3.1 is already "modern" Python.

Copy link
Copy Markdown
Member Author

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

Done.

Comment thread Doc/c-api/intro.rst Outdated
Comment thread Doc/c-api/intro.rst Outdated
ZeroIntensity requested a review from picnixz January 31, 2026 17:57
Comment thread Doc/c-api/intro.rst Outdated
Comment thread Doc/c-api/intro.rst

*value*, *larger*, and *smaller* may all be evaluated more than once in the
expression; consequently, do not pass an expensive operation directly to
this macro.

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

Expressions with side effects (ex: value++) should also be avoided.

Co-authored-by: Victor Stinner <vstinner@python.org>
Comment thread Doc/c-api/intro.rst
Comment thread Doc/c-api/intro.rst Outdated

vstinner left a comment

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

ZeroIntensity merged commit 914fbec into python:main Feb 4, 2026
42 checks passed
ZeroIntensity deleted the document-more-macros branch February 4, 2026 16:43
github-project-automation Bot moved this from Todo to Done in Docs PRs Feb 4, 2026

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 Feb 4, 2026
…GH-144279)

(cherry picked from commit 914fbec)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

bedevere-app Bot commented Feb 4, 2026

Copy link
Copy Markdown

GH-144477 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 Feb 4, 2026

bedevere-app Bot commented Feb 4, 2026

Copy link
Copy Markdown

GH-144478 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 Feb 4, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 4, 2026
…GH-144279)

(cherry picked from commit 914fbec)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
ZeroIntensity added a commit that referenced this pull request Feb 4, 2026
…4279) (GH-144477)

gh-141004: Document remaining `pyport.h` utility macros (GH-144279)
(cherry picked from commit 914fbec)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
ZeroIntensity added a commit that referenced this pull request Feb 4, 2026
…4279) (GH-144478)

gh-141004: Document remaining `pyport.h` utility macros (GH-144279)
(cherry picked from commit 914fbec)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
encukou added a commit to encukou/cpython that referenced this pull request Feb 5, 2026
encukou pushed a commit to encukou/cpython that referenced this pull request Feb 5, 2026
…GH-144279)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
…GH-144279)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…GH-144279)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
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 topic-C-API

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL