Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-141004: Reorganize and reword the 'Useful macros' section#144471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
encukou wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromencukou:doc-useful-macros

Conversation

@encukou
Copy link
Member

@encukouencukou commentedFeb 4, 2026
edited by github-actionsbot
Loading

This is a follow-up to#143508. When all the public macros were documented, the section became somewhat unwieldy.

  • 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

📚 Documentation preview 📚:https://cpython-previews--144471.org.readthedocs.build/

- 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
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

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``.
Copy link
Member

Choose a reason for hiding this comment

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

Note: C11 added_Noreturn, but C23 adds[[noreturn]] and deprecates_Noreturn.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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>
@encukou
Copy link
MemberAuthor

it may be interesting to sort functions in each category

Sort by what?
IMO, sorting by relevance works great, even though it's not objective.

@vstinner
Copy link
Member

Sort by what?

I'm thinking at the alphabetical order.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner left review comments

@ZeroIntensityZeroIntensityAwaiting requested review from ZeroIntensity

Assignees

No one assigned

Labels

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@encukou@vstinner

[8]ページ先頭

©2009-2026 Movatter.jp