diff options
author | Petri Lehtinen <petri@digip.org> | 2011-11-05 08:21:49 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2011-11-05 08:22:03 (GMT) |
commit | 064e39330db471d2c31bd5abc101f5f9aea5b3e3 (patch) | |
tree | 961c8591a436c81bd68f076cd5c739fb16d8a361 /Doc | |
parent | 8c481b6212d2158bef06eea1f1ed32a015cfc486 (diff) | |
parent | 395ca7238015eb5aacadde2917c185cba5fea726 (diff) | |
download | cpython-064e39330db471d2c31bd5abc101f5f9aea5b3e3.zip cpython-064e39330db471d2c31bd5abc101f5f9aea5b3e3.tar.gz cpython-064e39330db471d2c31bd5abc101f5f9aea5b3e3.tar.bz2 |
Issue #3067: Enhance the documentation and docstring of locale.setlocale()
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/locale.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index dd6f954..3a49e98 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -22,19 +22,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=None) - 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. |