Skip to content

Commit 0fd6f83

Browse files
miss-islingtonandresdelfino
authored andcommitted
bpo-34432: doc Mention complex and decimal.Decimal on str.format note about locales (GH-8808) (GH-8809)
(cherry picked from commit 93b5655) Co-authored-by: Andrés Delfino <[email protected]>
1 parent eeece3c commit 0fd6f83

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/library/stdtypes.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,13 +1606,14 @@ expression support in the :mod:`re` module).
16061606
that can be specified in format strings.
16071607

16081608
.. note::
1609-
When formatting a number (:class:`int`, :class:`float`, :class:`float`
1610-
and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the
1611-
function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC``
1612-
locale to decode ``decimal_point`` and ``thousands_sep`` fields of
1613-
:c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the
1614-
``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This
1615-
temporary change affects other threads.
1609+
When formatting a number (:class:`int`, :class:`float`, :class:`complex`,
1610+
:class:`decimal.Decimal` and subclasses) with the ``n`` type
1611+
(ex: ``'{:n}'.format(1234)``), the function temporarily sets the
1612+
``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
1613+
``decimal_point`` and ``thousands_sep`` fields of :c:func:`localeconv` if
1614+
they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is
1615+
different than the ``LC_CTYPE`` locale. This temporary change affects
1616+
other threads.
16161617

16171618
.. versionchanged:: 3.7
16181619
When formatting a number with the ``n`` type, the function sets

0 commit comments

Comments
 (0)