From 999d6350bf47f83edccbb2c491ea1dbca0b148ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Delfino?= Date: Sat, 18 Aug 2018 14:05:48 -0300 Subject: [PATCH 1/2] bpo-34432: doc Mention complex and decimal.Decimal on str.format note about locales --- Doc/library/stdtypes.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 128c1bd24a4f49a..df590b8fafb35e5 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -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 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. .. versionchanged:: 3.7 When formatting a number with the ``n`` type, the function sets From 86e5f76887e3726e78a5314fbc39d7ce48b8647e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Delfino?= Date: Sat, 18 Aug 2018 14:22:52 -0300 Subject: [PATCH 2/2] "sets temporarily" to "temporarily sets" --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index df590b8fafb35e5..db233df5c1e56c6 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1608,7 +1608,7 @@ expression support in the :mod:`re` module). .. note:: 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 sets temporarily the + (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