gh-139165: Make Py_SIZE, Py_IS_TYPE,Py_ SET_SIZE regular functions in stable ABI (GH-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.
This commit is contained in:
Petr Viktorin 2025-11-25 14:30:33 +01:00 committed by GitHub
parent e6174ee981
commit 226011ba12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 92 additions and 61 deletions

3
PC/python3dll.c generated
View file

@ -71,6 +71,7 @@ EXPORT_FUNC(Py_IncRef)
EXPORT_FUNC(Py_Initialize)
EXPORT_FUNC(Py_InitializeEx)
EXPORT_FUNC(Py_Is)
EXPORT_FUNC(Py_IS_TYPE)
EXPORT_FUNC(Py_IsFalse)
EXPORT_FUNC(Py_IsFinalizing)
EXPORT_FUNC(Py_IsInitialized)
@ -86,10 +87,12 @@ EXPORT_FUNC(Py_PACK_VERSION)
EXPORT_FUNC(Py_REFCNT)
EXPORT_FUNC(Py_ReprEnter)
EXPORT_FUNC(Py_ReprLeave)
EXPORT_FUNC(Py_SET_SIZE)
EXPORT_FUNC(Py_SetPath)
EXPORT_FUNC(Py_SetProgramName)
EXPORT_FUNC(Py_SetPythonHome)
EXPORT_FUNC(Py_SetRecursionLimit)
EXPORT_FUNC(Py_SIZE)
EXPORT_FUNC(Py_TYPE)
EXPORT_FUNC(Py_VaBuildValue)
EXPORT_FUNC(Py_XNewRef)