From 65e0781b7b0e4d72d3998df94276a72c2fe9d3ac Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 25 Jul 2024 16:14:02 +0300 Subject: [PATCH 1/4] Document PyLong_GetInfo() (part of Limited API) --- Doc/c-api/long.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 42162914c0aec8..aea5aab7c98166 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -514,6 +514,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. .. versionadded:: 3.14 +.. c:function:: PyObject* PyLong_GetInfo(void) + + On success, return a read only :term:`named tuple`, that holds + information about Python's internal representation of integers. + See :data:`sys.int_info` for description of individual fields. + + On failure, return ``NULL`` with an exception set. + + .. versionadded:: 3.2 + + .. c:function:: int PyUnstable_Long_IsCompact(const PyLongObject* op) Return 1 if *op* is compact, 0 otherwise. From 628a6bee963113ae2b489cc4e5f194e382597974 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 27 Jul 2024 14:36:40 +0300 Subject: [PATCH 2/4] Update Doc/c-api/long.rst Co-authored-by: Petr Viktorin --- Doc/c-api/long.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index aea5aab7c98166..9f2c48d98b8344 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -522,7 +522,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. On failure, return ``NULL`` with an exception set. - .. versionadded:: 3.2 + .. versionadded:: 3.1 .. c:function:: int PyUnstable_Long_IsCompact(const PyLongObject* op) From 9194f1c94db479b347ee8ca1157a86e880fd857a Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 27 Jul 2024 14:54:26 +0300 Subject: [PATCH 3/4] + update Misc/stable_abi.toml --- Doc/data/stable_abi.dat | 2 +- Misc/stable_abi.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 90ddb3fd8213ca..57020143323ba4 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -375,7 +375,7 @@ func,PyLong_FromString,3.2,, func,PyLong_FromUnsignedLong,3.2,, func,PyLong_FromUnsignedLongLong,3.2,, func,PyLong_FromVoidPtr,3.2,, -func,PyLong_GetInfo,3.2,, +func,PyLong_GetInfo,3.1,, data,PyLong_Type,3.2,, data,PyMap_Type,3.2,, func,PyMapping_Check,3.2,, diff --git a/Misc/stable_abi.toml b/Misc/stable_abi.toml index 73012193d61485..0f166d893d27ec 100644 --- a/Misc/stable_abi.toml +++ b/Misc/stable_abi.toml @@ -971,7 +971,7 @@ [function.PyLong_FromVoidPtr] added = '3.2' [function.PyLong_GetInfo] - added = '3.2' + added = '3.1' [data.PyLong_Type] added = '3.2' [data.PyMap_Type] From 40b43c8405f00725f355890753c522d49190d96a Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 27 Jul 2024 15:22:55 +0300 Subject: [PATCH 4/4] Revert "+ update Misc/stable_abi.toml" This reverts commit 9194f1c94db479b347ee8ca1157a86e880fd857a. --- Doc/data/stable_abi.dat | 2 +- Misc/stable_abi.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 57020143323ba4..90ddb3fd8213ca 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -375,7 +375,7 @@ func,PyLong_FromString,3.2,, func,PyLong_FromUnsignedLong,3.2,, func,PyLong_FromUnsignedLongLong,3.2,, func,PyLong_FromVoidPtr,3.2,, -func,PyLong_GetInfo,3.1,, +func,PyLong_GetInfo,3.2,, data,PyLong_Type,3.2,, data,PyMap_Type,3.2,, func,PyMapping_Check,3.2,, diff --git a/Misc/stable_abi.toml b/Misc/stable_abi.toml index 0f166d893d27ec..73012193d61485 100644 --- a/Misc/stable_abi.toml +++ b/Misc/stable_abi.toml @@ -971,7 +971,7 @@ [function.PyLong_FromVoidPtr] added = '3.2' [function.PyLong_GetInfo] - added = '3.1' + added = '3.2' [data.PyLong_Type] added = '3.2' [data.PyMap_Type]