Skip to content

Commit 9b0179f

Browse files
gh-141004: Document Py_DTSF_* macros (GH-141310)
1 parent b618731 commit 9b0179f

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

Doc/c-api/conversion.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,28 @@ The following functions provide locale-independent string to number conversions.
128128
must be 0 and is ignored. The ``'r'`` format code specifies the
129129
standard :func:`repr` format.
130130
131-
*flags* can be zero or more of the values ``Py_DTSF_SIGN``,
132-
``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:
131+
*flags* can be zero or more of the following values or-ed together:
133132
134-
* ``Py_DTSF_SIGN`` means to always precede the returned string with a sign
135-
character, even if *val* is non-negative.
133+
.. c:macro:: Py_DTSF_SIGN
136134
137-
* ``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look
138-
like an integer.
135+
Always precede the returned string with a sign
136+
character, even if *val* is non-negative.
139137
140-
* ``Py_DTSF_ALT`` means to apply "alternate" formatting rules. See the
141-
documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
142-
details.
138+
.. c:macro:: Py_DTSF_ADD_DOT_0
139+
140+
Ensure that the returned string will not look like an integer.
141+
142+
.. c:macro:: Py_DTSF_ALT
143+
144+
Apply "alternate" formatting rules.
145+
See the documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
146+
details.
147+
148+
.. c:macro:: Py_DTSF_NO_NEG_0
149+
150+
Negative zero is converted to positive zero.
151+
152+
.. versionadded:: 3.11
143153
144154
If *ptype* is non-``NULL``, then the value it points to will be set to one of
145155
``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that

0 commit comments

Comments
 (0)