Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Sep 19, 2025

Group them together with Py_TYPE & Py_SET_TYPE to cut down on repetitive preprocessor macros.
Format repetitive definitions in object.c more concisely.

Py_SET_TYPE is still left out of the Limited API.


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

Group them together with Py_TYPE & Py_SET_TYPE to cut down
on repetitive preprocessor macros.
Format repetitive definitions in object.c more concisely.

Py_SET_TYPE is still left out of the Limited API.
Include/object.h Outdated
Comment on lines 325 to 326
#elif Py_LIMITED_API+0 < _Py_PACK_VERSION(3, 15)
# if Py_LIMITED_API+0 < _Py_PACK_VERSION(3, 14)
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean >=?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but I can expand the comments :)

- Don't expose the "real" functions for old Limited API
- Move implementations below defines so that they pick up
  the right Py_TYPE definition
@encukou encukou marked this pull request as ready for review November 20, 2025 12:54
@encukou encukou requested review from a team and ZeroIntensity as code owners November 20, 2025 12:54
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@encukou encukou merged commit 226011b into python:main Nov 25, 2025
52 checks passed
@encukou encukou deleted the size-functions branch November 25, 2025 13:30
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…ons in stable ABI (pythonGH-139166)

* Make Py_{SIZE,IS_TYPE,SET_SIZE} regular functions in stable ABI

Group them together with Py_TYPE & Py_SET_TYPE to cut down
on repetitive preprocessor macros.
Format repetitive definitions in object.c more concisely.

Py_SET_TYPE is still left out of the Limited API.
ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull request Dec 8, 2025
…ons in stable ABI (pythonGH-139166)

* Make Py_{SIZE,IS_TYPE,SET_SIZE} regular functions in stable ABI

Group them together with Py_TYPE & Py_SET_TYPE to cut down
on repetitive preprocessor macros.
Format repetitive definitions in object.c more concisely.

Py_SET_TYPE is still left out of the Limited API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants