summaryrefslogtreecommitdiffstats
path: root/Doc/library/json.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-29 02:02:14 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-29 02:02:14 (GMT)
commite612c1e29f69c6704d8382cbfeaa8358a5e7fb3b (patch)
tree811d8408ed3ee39c03de55da1e4570d2989b86e3 /Doc/library/json.rst
parent85a25222bcad7d2d059e7b5c00b2bff5e2a6e7c7 (diff)
parent6d2bc6e80b53658bd249480c3e1172b7546caea1 (diff)
downloadcpython-e612c1e29f69c6704d8382cbfeaa8358a5e7fb3b.zip
cpython-e612c1e29f69c6704d8382cbfeaa8358a5e7fb3b.tar.gz
cpython-e612c1e29f69c6704d8382cbfeaa8358a5e7fb3b.tar.bz2
#17438: merge with 3.3.
Diffstat (limited to 'Doc/library/json.rst')
-rw-r--r--Doc/library/json.rst17
1 files changed, 12 insertions, 5 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 9bafcfe..faa7ac9 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -123,7 +123,8 @@ Basic Usage
sort_keys=False, **kw)
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
- :term:`file-like object`).
+ :term:`file-like object`) using this :ref:`conversion table
+ <py-to-json-table>`.
If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`,
@@ -180,8 +181,9 @@ Basic Usage
indent=None, separators=None, default=None, \
sort_keys=False, **kw)
- Serialize *obj* to a JSON formatted :class:`str`. The arguments have the
- same meaning as in :func:`dump`.
+ Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
+ table <py-to-json-table>`. The arguments have the same meaning as in
+ :func:`dump`.
.. note::
@@ -201,7 +203,8 @@ Basic Usage
.. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
Deserialize *fp* (a ``.read()``-supporting :term:`file-like object`
- containing a JSON document) to a Python object.
+ containing a JSON document) to a Python object using this :ref:`conversion
+ table <json-to-py-table>`.
*object_hook* is an optional function that will be called with the result of
any object literal decoded (a :class:`dict`). The return value of
@@ -246,7 +249,7 @@ Basic Usage
.. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
Deserialize *s* (a :class:`str` instance containing a JSON document) to a
- Python object.
+ Python object using this :ref:`conversion table <json-to-py-table>`.
The other arguments have the same meaning as in :func:`load`, except
*encoding* which is ignored and deprecated.
@@ -261,6 +264,8 @@ Encoders and Decoders
Performs the following translations in decoding by default:
+ .. _json-to-py-table:
+
+---------------+-------------------+
| JSON | Python |
+===============+===================+
@@ -342,6 +347,8 @@ Encoders and Decoders
Supports the following objects and types by default:
+ .. _py-to-json-table:
+
+-------------------+---------------+
| Python | JSON |
+===================+===============+