gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974)

Now it returns a tuple of up to 100 strings (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
This commit is contained in:
Serhiy Storchaka 2024-10-09 11:42:08 +03:00 committed by GitHub
parent 92760bd85b
commit 21c04e1a97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 74 additions and 6 deletions

View file

@ -158,7 +158,8 @@ The :mod:`locale` module defines the following exception and functions:
.. function:: nl_langinfo(option)
Return some locale-specific information as a string. This function is not
Return some locale-specific information as a string (or a tuple for
``ALT_DIGITS``). This function is not
available on all systems, and the set of possible options might also vary
across platforms. The possible argument values are numbers, for which
symbolic constants are available in the locale module.
@ -311,8 +312,7 @@ The :mod:`locale` module defines the following exception and functions:
.. data:: ALT_DIGITS
Get a representation of up to 100 values used to represent the values
0 to 99.
Get a tuple of up to 100 strings used to represent the values 0 to 99.
The function temporarily sets the ``LC_CTYPE`` locale to the locale
of the category that determines the requested value (``LC_TIME``,