Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd7f32b

Browse files
committed
Signature documentation style update, modules J, K, L and M.
1 parent cdf8b34 commit cd7f32b

20 files changed

Lines changed: 100 additions & 116 deletions

Doc/library/json.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Using json.tool from the shell to validate and pretty-print::
112112
Basic Usage
113113
-----------
114114

115-
.. function:: dump(obj, fp[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]])
115+
.. function:: dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, **kw)
116116

117117
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
118118
file-like object).
@@ -126,7 +126,6 @@ Basic Usage
126126
:class:`bytes` objects. Therefore, ``fp.write()`` must support :class:`str`
127127
input.
128128

129-
130129
If *check_circular* is ``False`` (default: ``True``), then the circular
131130
reference check for container types will be skipped and a circular reference
132131
will result in an :exc:`OverflowError` (or worse).
@@ -153,13 +152,13 @@ Basic Usage
153152
*cls* kwarg.
154153

155154

156-
.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]])
155+
.. function:: dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, **kw)
157156

158157
Serialize *obj* to a JSON formatted :class:`str`. The arguments have the
159158
same meaning as in :func:`dump`.
160159

161160

162-
.. function:: load(fp[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
161+
.. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
163162

164163
Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON
165164
document) to a Python object.
@@ -200,7 +199,7 @@ Basic Usage
200199
class.
201200

202201

203-
.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
202+
.. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
204203

205204
Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
206205
document) to a Python object.
@@ -216,7 +215,7 @@ Basic Usage
216215
Encoders and decoders
217216
---------------------
218217

219-
.. class:: JSONDecoder([encoding[, object_hook[, parse_float[, parse_int[, parse_constant[, strict[, object_pairs_hook]]]]]]])
218+
.. class:: JSONDecoder(object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
220219

221220
Simple JSON decoder.
222221

@@ -292,7 +291,7 @@ Encoders and decoders
292291
extraneous data at the end.
293292

294293

295-
.. class:: JSONEncoder([skipkeys[, ensure_ascii[, check_circular[, allow_nan[, sort_keys[, indent[, separators[, default]]]]]]]])
294+
.. class:: JSONEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
296295

297296
Extensible JSON encoder for Python data structures.
298297

Doc/library/keyword.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
:mod:`keyword` --- Testing for Python keywords
32
==============================================
43

Doc/library/language.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.. _language:
32

43
************************

Doc/library/linecache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
:mod:`linecache` --- Random access to text lines
32
================================================
43

@@ -15,7 +14,7 @@ to retrieve source lines for inclusion in the formatted traceback.
1514
The :mod:`linecache` module defines the following functions:
1615

1716

18-
.. function:: getline(filename, lineno[, module_globals])
17+
.. function:: getline(filename, lineno, module_globals=None)
1918

2019
Get line *lineno* from file named *filename*. This function will never throw an
2120
exception --- it will return ``''`` on errors (the terminating newline character
@@ -35,12 +34,13 @@ The :mod:`linecache` module defines the following functions:
3534
previously read using :func:`getline`.
3635

3736

38-
.. function:: checkcache([filename])
37+
.. function:: checkcache(filename=None)
3938

4039
Check the cache for validity. Use this function if files in the cache may have
4140
changed on disk, and you require the updated version. If *filename* is omitted,
4241
it will check all the entries in the cache.
4342

43+
4444
Example::
4545

4646
>>> import linecache

Doc/library/locale.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
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

Comments
 (0)