mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-94226: Remove the locale.format() function (#94229)
Remove the locale.format() function, deprecated in Python 3.7: use locale.format_string() instead. Remove TestFormatPatternArg test case: it is irrelevant for locale.format_string() which accepts complex formats.
This commit is contained in:
parent
44c8e68b8c
commit
cc0d5e568e
6 changed files with 58 additions and 102 deletions
|
@ -412,18 +412,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
The *monetary* keyword parameter was added.
|
||||
|
||||
|
||||
.. function:: format(format, val, grouping=False, monetary=False)
|
||||
|
||||
Please note that this function works like :meth:`format_string` but will
|
||||
only work for exactly one ``%char`` specifier. For example, ``'%f'`` and
|
||||
``'%.0f'`` are both valid specifiers, but ``'%f KiB'`` is not.
|
||||
|
||||
For whole format strings, use :func:`format_string`.
|
||||
|
||||
.. deprecated:: 3.7
|
||||
Use :meth:`format_string` instead.
|
||||
|
||||
|
||||
.. function:: currency(val, symbol=True, grouping=False, international=False)
|
||||
|
||||
Formats a number *val* according to the current :const:`LC_MONETARY` settings.
|
||||
|
@ -507,7 +495,7 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
|
||||
.. data:: LC_NUMERIC
|
||||
|
||||
Locale category for formatting numbers. The functions :func:`.format`,
|
||||
Locale category for formatting numbers. The functions :func:`format_string`,
|
||||
:func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`locale` module are
|
||||
affected by that category. All other numeric formatting operations are not
|
||||
affected.
|
||||
|
@ -569,7 +557,7 @@ document that your module is not compatible with non-\ ``C`` locale settings.
|
|||
|
||||
The only way to perform numeric operations according to the locale is to use the
|
||||
special functions defined by this module: :func:`atof`, :func:`atoi`,
|
||||
:func:`.format`, :func:`.str`.
|
||||
:func:`format_string`, :func:`.str`.
|
||||
|
||||
There is no way to perform case conversions and character classifications
|
||||
according to the locale. For (Unicode) text strings these are done according
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue