Skip to content

Commit 4954f97

Browse files
Add cocumentation.
1 parent 1e65e5b commit 4954f97

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

Doc/library/locale.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The :mod:`locale` module defines the following exception and functions:
4242
If *locale* is a pair, it is converted to a locale name using
4343
the locale aliasing engine.
4444
The language code has the same format as a :ref:`locale name <locale_name>`,
45-
but without encoding and ``@``-modifier.
45+
but without encoding.
4646
The language code and encoding can be ``None``.
4747

4848
If *locale* is omitted or ``None``, the current setting for *category* is
@@ -58,6 +58,9 @@ The :mod:`locale` module defines the following exception and functions:
5858
specified in the :envvar:`LANG` environment variable). If the locale is not
5959
changed thereafter, using multithreading should not cause problems.
6060

61+
.. verssionchanged:: next
62+
Support language codes with ``@``-modifiers.
63+
6164

6265
.. function:: localeconv()
6366

@@ -366,11 +369,14 @@ The :mod:`locale` module defines the following exception and functions:
366369
values except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`.
367370

368371
The language code has the same format as a :ref:`locale name <locale_name>`,
369-
but without encoding and ``@``-modifier.
372+
but without encoding.
370373
The language code and encoding may be ``None`` if their values cannot be
371374
determined.
372375
The "C" locale is represented as ``(None, None)``.
373376

377+
.. verssionchanged:: next
378+
The language code can now contain a ``@``-modifier.
379+
374380

375381
.. function:: getpreferredencoding(do_setlocale=True)
376382

Doc/whatsnew/3.15.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ http.client
263263
(Contributed by Alexander Enrique Urieles Nieto in :gh:`131724`.)
264264

265265

266+
locale
267+
------
268+
269+
* :func:`~locale.setlocale` now supports language codes with ``@``-modifiers.
270+
``@``-modifier are no longer silently removed in :func:`~locale.getlocale`,
271+
but included in the language code.
272+
(Contributed by Serhiy Storchaka in :gh:`137729`.)
273+
274+
266275
math
267276
----
268277

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:func:`locale.setlocale` now supports language codes with ``@``-modifiers.
2+
``@``-modifier are no longer silently removed in :func:`locale.getlocale`,
3+
but included in the language code.

0 commit comments

Comments
 (0)