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:
Victor Stinner 2022-06-26 12:41:19 +02:00 committed by GitHub
parent 44c8e68b8c
commit cc0d5e568e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 102 deletions

View file

@ -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