bpo-34432: doc Mention complex and decimal.Decimal on str.format not about locales (GH-8808)

This commit is contained in:
Andrés Delfino 2018-08-18 14:36:24 -03:00 committed by Eric V. Smith
parent cae8ff93a6
commit 93b5655c04

View file

@ -1606,13 +1606,14 @@ expression support in the :mod:`re` module).
that can be specified in format strings. that can be specified in format strings.
.. note:: .. note::
When formatting a number (:class:`int`, :class:`float`, :class:`float` When formatting a number (:class:`int`, :class:`float`, :class:`complex`,
and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the :class:`decimal.Decimal` and subclasses) with the ``n`` type
function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` (ex: ``'{:n}'.format(1234)``), the function temporarily sets the
locale to decode ``decimal_point`` and ``thousands_sep`` fields of ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
:c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the ``decimal_point`` and ``thousands_sep`` fields of :c:func:`localeconv` if
``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is
temporary change affects other threads. different than the ``LC_CTYPE`` locale. This temporary change affects
other threads.
.. versionchanged:: 3.7 .. versionchanged:: 3.7
When formatting a number with the ``n`` type, the function sets When formatting a number with the ``n`` type, the function sets