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

@ -59,7 +59,7 @@ formatting numbers with group separators::
'English_United States.1252'
>>> conv = locale.localeconv() # get a mapping of conventions
>>> x = 1234567.8
>>> locale.format("%d", x, grouping=True)
>>> locale.format_string("%d", x, grouping=True)
'1,234,567'
>>> locale.format_string("%s%.*f", (conv['currency_symbol'],
... conv['frac_digits'], x), grouping=True)