mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-141004: Document Py_DTSF_* macros (GH-141310) (GH-141329)
gh-141004: Document `Py_DTSF_*` macros (GH-141310)
(cherry picked from commit 9b0179fa87)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
6cbb8cb1f7
commit
b5ae8082a6
1 changed files with 19 additions and 9 deletions
|
|
@ -128,19 +128,29 @@ The following functions provide locale-independent string to number conversions.
|
||||||
must be 0 and is ignored. The ``'r'`` format code specifies the
|
must be 0 and is ignored. The ``'r'`` format code specifies the
|
||||||
standard :func:`repr` format.
|
standard :func:`repr` format.
|
||||||
|
|
||||||
*flags* can be zero or more of the values ``Py_DTSF_SIGN``,
|
*flags* can be zero or more of the following values or-ed together:
|
||||||
``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:
|
|
||||||
|
|
||||||
* ``Py_DTSF_SIGN`` means to always precede the returned string with a sign
|
.. c:macro:: Py_DTSF_SIGN
|
||||||
|
|
||||||
|
Always precede the returned string with a sign
|
||||||
character, even if *val* is non-negative.
|
character, even if *val* is non-negative.
|
||||||
|
|
||||||
* ``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look
|
.. c:macro:: Py_DTSF_ADD_DOT_0
|
||||||
like an integer.
|
|
||||||
|
|
||||||
* ``Py_DTSF_ALT`` means to apply "alternate" formatting rules. See the
|
Ensure that the returned string will not look like an integer.
|
||||||
documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
|
|
||||||
|
.. c:macro:: Py_DTSF_ALT
|
||||||
|
|
||||||
|
Apply "alternate" formatting rules.
|
||||||
|
See the documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
|
||||||
details.
|
details.
|
||||||
|
|
||||||
|
.. c:macro:: Py_DTSF_NO_NEG_0
|
||||||
|
|
||||||
|
Negative zero is converted to positive zero.
|
||||||
|
|
||||||
|
.. versionadded:: 3.11
|
||||||
|
|
||||||
If *ptype* is non-``NULL``, then the value it points to will be set to one of
|
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
|
``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.
|
*val* is a finite number, an infinite number, or not a number, respectively.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue