diff options
| author | Georg Brandl <georg@python.org> | 2010-10-15 17:04:45 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-10-15 17:04:45 (GMT) |
| commit | db949b8fae924a852fc68fea9a01fc04fd868758 (patch) | |
| tree | 18dfa1c331aeca22a6850e47a6a7af7891294c99 /Doc/library/json.rst | |
| parent | 44c3ceb8aca1bc1bbb6de97a69fedfef360e590a (diff) | |
| download | cpython-db949b8fae924a852fc68fea9a01fc04fd868758.zip cpython-db949b8fae924a852fc68fea9a01fc04fd868758.tar.gz cpython-db949b8fae924a852fc68fea9a01fc04fd868758.tar.bz2 | |
Recorded merge of revisions 85543 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85543 | georg.brandl | 2010-10-15 19:03:02 +0200 (Fr, 15 Okt 2010) | 1 line
#4785: document strict argument of JSONDecoder, plus add object_pairs_hook in the docstrings.
........
Diffstat (limited to 'Doc/library/json.rst')
| -rw-r--r-- | Doc/library/json.rst | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst index f708052..bb26f35 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -154,7 +154,7 @@ Basic Usage To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :meth:`default` method to serialize additional types), specify it with the - *cls* kwarg. + *cls* kwarg; otherwise :class:`JSONEncoder` is used. .. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) @@ -209,8 +209,8 @@ Basic Usage are encountered. To use a custom :class:`JSONDecoder` subclass, specify it with the ``cls`` - kwarg. Additional keyword arguments will be passed to the constructor of the - class. + kwarg; otherwise :class:`JSONDecoder` is used. Additional keyword arguments + will be passed to the constructor of the class. .. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]]) @@ -296,6 +296,11 @@ Encoders and decoders ``'false'``. This can be used to raise an exception if invalid JSON numbers are encountered. + If *strict* is ``False`` (``True`` is the default), then control characters + will be allowed inside strings. Control characters in this context are + those with character codes in the 0-31 range, including ``'\t'`` (tab), + ``'\n'``, ``'\r'`` and ``'\0'``. + .. method:: decode(s) |
