Skip to content

gh-157495: Implement Py_MIN() and Py_MAX() using typeof() - #157496

Open
vstinner wants to merge 6 commits into
python:mainfrom
vstinner:max_typeof
Open

vstinner wants to merge 6 commits into
python:mainfrom
vstinner:max_typeof

Conversation

@vstinner

@vstinner vstinner commented Sep 14, 2026

Copy link
Copy Markdown
Member

If typeof() is available, implement Py_MIN(), Py_MAX() and Py_ABS() using typeof() and statement expression to only evaluate each argument once.

Test also these macros in test_cext and test_cppext to test different compiler flags and test the limited C API.

If typeof() is available, implement Py_MIN(), Py_MAX() and Py_ABS()
using typeof() and statement expression to only evaluate each
argument once.

Test also these macros in test_cext and test_cppext to test different
compiler flags and test the limited C API.
@vstinner

Copy link
Copy Markdown
Member Author

Oh, statement expression is a GNU extension. So it should only be used on GCC and clang.

@vstinner vstinner added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 15, 2026
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 56d145a 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157496%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 15, 2026
@vstinner

Copy link
Copy Markdown
Member Author

I scheduled buildbots tests to check test_cext and test_cppext. These tests are skipped on GitHub Action CI jobs.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants