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

gh-158942: Use more unique variable names in Py_MIN/MAX/ABS() by vstinner · Pull Request #158969 · python/cpython · GitHub

Repository navigation

gh-158942: Use more unique variable names in Py_MIN/MAX/ABS() - #158969

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:pymin_var_name
Oct 8, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:pymin_var_name

Conversation

vstinner commented Oct 7, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

If Py_MIN/MAX/ABS() macros are called on an existing "_x" or "_y" variable name, the macro local variables may be overriden by the external variables. So use more unique names in the macros.

Add test_min_max_abs_macros() to _testlimitedcapi.

If Py_MIN/MAX/ABS() macros are called on an existing "_x" or "_y"
variable name, the macro local variables may be overriden by the
external variables. So use more unique names in the macros.

Add test_min_max_abs_macros() to _testlimitedcapi.

vstinner commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

cc @lpyu001 @ZeroIntensity

lpyu001 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

If the other compatibility changes are considered acceptable, I have no objection to this change.

For reference, I also used an LLM to scan 1,561 PyPI packages with C extensions and found only one case of nested Py_MIN() usage, in librt.

vstinner enabled auto-merge (squash) October 8, 2026 17:21
vstinner merged commit e2c3c7e into python:main Oct 8, 2026
52 checks passed
vstinner deleted the pymin_var_name branch October 8, 2026 17:48
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL