From: Sergey B Kirpichev Date: Mon, 5 Aug 2024 18:11:42 +0000 (+0300) Subject: [3.12] gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-122280) (#122644) X-Git-Tag: v3.12.5~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ff41583fdf6118fe762c4d46a37b776c135c3a9;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-122280) (#122644) [3.12] gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-GH-122280) (cherry picked from commit d91ac525ef166edc0083acf5a96f81b87324fe7f) --- diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 76ac80322f8f..af86810c6b16 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -324,6 +324,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate. +.. 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.1 + + .. c:function:: int PyUnstable_Long_IsCompact(const PyLongObject* op) Return 1 if *op* is compact, 0 otherwise.