[Python-checkins] cpython (2.7): #17438: add links to the conversion tables in dump(s)/load(s).

ezio.melotti python-checkins at python.org
Fri Mar 29 03:02:30 CET 2013


http://hg.python.org/cpython/rev/80d7545594ca
changeset:   82996:80d7545594ca
branch:      2.7
parent:      82993:0753a663d27c
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Fri Mar 29 03:59:29 2013 +0200
summary:
  #17438: add links to the conversion tables in dump(s)/load(s).

files:
  Doc/library/json.rst |  20 ++++++++++++++------
  1 files changed, 14 insertions(+), 6 deletions(-)


diff --git a/Doc/library/json.rst b/Doc/library/json.rst
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -125,7 +125,8 @@
                    default=None, 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:`unicode`, :class:`int`, :class:`long`,
@@ -188,9 +189,10 @@
                     indent=None, separators=None, encoding="utf-8", \
                     default=None, sort_keys=False, **kw)
 
-   Serialize *obj* to a JSON formatted :class:`str`.  If *ensure_ascii* is
-   ``False``, the result may contain non-ASCII characters and the return value
-   may be a :class:`unicode` instance.
+   Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
+   table <py-to-json-table>`.  If *ensure_ascii* is ``False``, the result may
+   contain non-ASCII characters and the return value may be a :class:`unicode`
+   instance.
 
    The arguments have the same meaning as in :func:`dump`.
 
@@ -206,7 +208,8 @@
 .. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **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>`.
 
    If the contents of *fp* are encoded with an ASCII based encoding other than
    UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be specified.
@@ -257,7 +260,8 @@
 .. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
 
    Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
-   document) to a Python object.
+   document) to a Python object using this :ref:`conversion table
+   <json-to-py-table>`.
 
    If *s* is a :class:`str` instance and is encoded with an ASCII based encoding
    other than UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be
@@ -276,6 +280,8 @@
 
    Performs the following translations in decoding by default:
 
+   .. _json-to-py-table:
+
    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
@@ -364,6 +370,8 @@
 
    Supports the following objects and types by default:
 
+   .. _py-to-json-table:
+
    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list