From 56ef89b7088a8e8ff15547e36e554a42a2cddc0c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 15 Jan 2026 13:24:02 +0100 Subject: [PATCH] gh-141004: Mark up constants for `PyOS_double_to_string` This ensures they show up as C macros in search and the Sphinx inventory. --- Doc/c-api/conversion.rst | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst index 96078d22710527..f7c8ef8b22b955 100644 --- a/Doc/c-api/conversion.rst +++ b/Doc/c-api/conversion.rst @@ -130,6 +130,8 @@ The following functions provide locale-independent string to number conversions. *flags* can be zero or more of the following values or-ed together: + .. c:namespace:: NULL + .. c:macro:: Py_DTSF_SIGN Always precede the returned string with a sign @@ -151,9 +153,21 @@ The following functions provide locale-independent string to number conversions. .. versionadded:: 3.11 - If *ptype* is non-``NULL``, then the value it points to will be set to one of - ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that - *val* is a finite number, an infinite number, or not a number, respectively. + If *ptype* is non-``NULL``, then the value it points to will be set to one + of the following constants depending on the type of *val*: + + .. list-table:: + :header-rows: 1 + :align: left + + * - *\*ptype* + - type of *val* + * - .. c:macro:: Py_DTST_FINITE + - finite number + * - .. c:macro:: Py_DTST_INFINITE + - infinite number + * - .. c:macro:: Py_DTST_NAN + - not a number The return value is a pointer to *buffer* with the converted string or ``NULL`` if the conversion failed. The caller is responsible for freeing the