gh-141004: Reorganize and reword the 'Useful macros' section#144471
Open
encukou wants to merge 2 commits intopython:mainfrom
Open
gh-141004: Reorganize and reword the 'Useful macros' section#144471encukou wants to merge 2 commits intopython:mainfrom
encukou wants to merge 2 commits intopython:mainfrom
Conversation
- Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler
vstinner
reviewed
Feb 4, 2026
Member
vstinner
left a comment
There was a problem hiding this comment.
Since you're already moving many functions, it may be interesting to sort functions in each category.
|
|
||
| A use for ``Py_UNREACHABLE()`` is following a call a function that | ||
| never returns but that is not declared :c:macro:`_Py_NO_RETURN`. | ||
| never returns but that is not declared ``_Noreturn``. |
Member
There was a problem hiding this comment.
Note: C11 added _Noreturn, but C23 adds [[noreturn]] and deprecates _Noreturn.
Member
Author
There was a problem hiding this comment.
I'm aware, but don't want to get in the details too much.
We require C11, and as far as I know, deprecations in the C standard don't mean planned removal.
Co-authored-by: Victor Stinner <vstinner@python.org>
Member
Author
Sort by what? |
Member
I'm thinking at the alphabetical order. |
Member
|
Sorry, I just caused conflicts here with #144279. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #143508. When all the public macros were documented, the section became somewhat unwieldy.
📚 Documentation preview 📚: https://cpython-previews--144471.org.readthedocs.build/