1-
21:mod: `locale ` --- Internationalization services
32===============================================
43
@@ -26,7 +25,7 @@ The :mod:`locale` module defines the following exception and functions:
2625 Exception raised when :func: `setlocale ` fails.
2726
2827
29- .. function :: setlocale(category[ , locale] )
28+ .. function :: setlocale(category, locale=None )
3029
3130 If *locale * is specified, it may be a string, a tuple of the form ``(language
3231 code, encoding) ``, or ``None ``. If it is a tuple, it is converted to a string
@@ -151,7 +150,7 @@ The :mod:`locale` module defines the following exception and functions:
151150 constants are available in the locale module.
152151
153152
154- .. function :: getdefaultlocale([ envvars] )
153+ .. function :: getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE') )
155154
156155 Tries to determine the default locale settings and returns them as a tuple of
157156 the form ``(language code, encoding) ``.
@@ -164,17 +163,17 @@ The :mod:`locale` module defines the following exception and functions:
164163
165164 To maintain compatibility with other platforms, not only the :envvar: `LANG `
166165 variable is tested, but a list of variables given as envvars parameter. The
167- first found to be defined will be used. *envvars * defaults to the search path
168- used in GNU gettext; it must always contain the variable name `` LANG ``. The GNU
169- gettext search path contains ``'LANGUAGE' ``, `` ' LC_ALL' ``, `` 'LC_CTYPE' ``, and
170- ``'LANG' ``, in that order.
166+ first found to be defined will be used. *envvars * defaults to the search
167+ path used in GNU gettext; it must always contain the variable name
168+ `` 'LANG' ``. The GNU gettext search path contains ``'LC_ALL' ``,
169+ ``'LC_CTYPE' ``, `` ' LANG' `` and `` 'LANGUAGE ' ``, in that order.
171170
172171 Except for the code ``'C' ``, the language code corresponds to :rfc: `1766 `.
173172 *language code * and *encoding * may be ``None `` if their values cannot be
174173 determined.
175174
176175
177- .. function :: getlocale([ category] )
176+ .. function :: getlocale(category=LC_CTYPE )
178177
179178 Returns the current setting for the given locale category as sequence containing
180179 *language code *, *encoding *. *category * may be one of the :const: `LC_\* ` values
@@ -185,7 +184,7 @@ The :mod:`locale` module defines the following exception and functions:
185184 determined.
186185
187186
188- .. function :: getpreferredencoding([ do_setlocale] )
187+ .. function :: getpreferredencoding(do_setlocale=True )
189188
190189 Return the encoding used for text data, according to user preferences. User
191190 preferences are expressed differently on different systems, and might not be
@@ -207,7 +206,7 @@ The :mod:`locale` module defines the following exception and functions:
207206 encoding for the locale code just like :func: `setlocale `.
208207
209208
210- .. function :: resetlocale([ category] )
209+ .. function :: resetlocale(category=LC_ALL )
211210
212211 Sets the locale for *category * to the default setting.
213212
@@ -232,7 +231,7 @@ The :mod:`locale` module defines the following exception and functions:
232231 sequence of strings.
233232
234233
235- .. function :: format(format, val[ , grouping[ , monetary]] )
234+ .. function :: format(format, val, grouping=False , monetary=False )
236235
237236 Formats a number *val * according to the current :const: `LC_NUMERIC ` setting.
238237 The format follows the conventions of the ``% `` operator. For floating point
@@ -246,13 +245,13 @@ The :mod:`locale` module defines the following exception and functions:
246245 For whole format strings, use :func: `format_string `.
247246
248247
249- .. function :: format_string(format, val[ , grouping] )
248+ .. function :: format_string(format, val, grouping=False )
250249
251250 Processes formatting specifiers as in ``format % val ``, but takes the current
252251 locale settings into account.
253252
254253
255- .. function :: currency(val[ , symbol[ , grouping[ , international]]] )
254+ .. function :: currency(val, symbol=True , grouping=False , international=False )
256255
257256 Formats a number *val * according to the current :const: `LC_MONETARY ` settings.
258257
0 commit comments