Skip to content

bpo-34432: doc Mention complex and decimal.Decimal on str.format note… #8808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1606,13 +1606,14 @@ expression support in the :mod:`re` module).
that can be specified in format strings.

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

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