diff options
author | Petri Lehtinen <petri@digip.org> | 2011-11-05 08:18:50 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2011-11-05 08:18:50 (GMT) |
commit | 416ecffcc49941a39ec3109eb20ae9ce558326ea (patch) | |
tree | 8e596a0880c41d66ac21866064114f5139f2d8c1 /Doc/library/locale.rst | |
parent | 49aa72ed4c48fb613893388b470aa5b5464c1952 (diff) | |
download | cpython-416ecffcc49941a39ec3109eb20ae9ce558326ea.zip cpython-416ecffcc49941a39ec3109eb20ae9ce558326ea.tar.gz cpython-416ecffcc49941a39ec3109eb20ae9ce558326ea.tar.bz2 |
Issue #3067: Enhance the documentation and docstring of locale.setlocale()
Diffstat (limited to 'Doc/library/locale.rst')
-rw-r--r-- | Doc/library/locale.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 85dad99..9cc3ab5 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -23,19 +23,19 @@ The :mod:`locale` module defines the following exception and functions: .. exception:: Error - Exception raised when :func:`setlocale` fails. + Exception raised when the locale passed to :func:`setlocale` is not + recognized. .. function:: setlocale(category[, locale]) - If *locale* is specified, it may be a string, a tuple of the form ``(language - code, encoding)``, or ``None``. If it is a tuple, it is converted to a string - using the locale aliasing engine. If *locale* is given and not ``None``, - :func:`setlocale` modifies the locale setting for the *category*. The available - categories are listed in the data description below. The value is the name of a - locale. An empty string specifies the user's default settings. If the - modification of the locale fails, the exception :exc:`Error` is raised. If - successful, the new locale setting is returned. + If *locale* is given and not ``None``, :func:`setlocale` modifies the locale + setting for the *category*. The available categories are listed in the data + description below. *locale* may be a string, or an iterable of two strings + (language code and encoding). If it's an iterable, it's converted to a locale + name using the locale aliasing engine. An empty string specifies the user's + default settings. If the modification of the locale fails, the exception + :exc:`Error` is raised. If successful, the new locale setting is returned. If *locale* is omitted or ``None``, the current setting for *category* is returned. @@ -51,7 +51,7 @@ The :mod:`locale` module defines the following exception and functions: changed thereafter, using multithreading should not cause problems. .. versionchanged:: 2.0 - Added support for tuple values of the *locale* parameter. + Added support for iterable values of the *locale* parameter. .. function:: localeconv() |