[Python-checkins] Doc: Improve library/json document. (GH-24390)

miss-islington webhook-mailer at python.org
Mon Mar 1 21:15:14 EST 2021


https://github.com/python/cpython/commit/f836e5f2194857b24ec03adfcfcce05375868f88
commit: f836e5f2194857b24ec03adfcfcce05375868f88
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-03-01T18:15:05-08:00
summary:

Doc: Improve library/json document. (GH-24390)

(cherry picked from commit a347bc0b35c982e9600838d5a545e244bb76a4bf)

Co-authored-by: Adorilson Bezerra <adorilson at gmail.com>

files:
M Doc/library/json.rst

diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index e1a246aad6190..c8184da80fe43 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -333,7 +333,7 @@ Encoders and Decoders
    *object_hook*, if specified, will be called with the result of every JSON
    object decoded and its return value will be used in place of the given
    :class:`dict`.  This can be used to provide custom deserializations (e.g. to
-   support JSON-RPC class hinting).
+   support `JSON-RPC <http://www.jsonrpc.org>`_ class hinting).
 
    *object_pairs_hook*, if specified will be called with the result of every
    JSON object decoded with an ordered list of pairs.  The return value of
@@ -422,10 +422,9 @@ Encoders and Decoders
    for ``o`` if possible, otherwise it should call the superclass implementation
    (to raise :exc:`TypeError`).
 
-   If *skipkeys* is false (the default), then it is a :exc:`TypeError` to
-   attempt encoding of keys that are not :class:`str`, :class:`int`,
-   :class:`float` or ``None``.  If *skipkeys* is true, such items are simply
-   skipped.
+   If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when
+   trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`
+   or ``None``.  If *skipkeys* is true, such items are simply skipped.
 
    If *ensure_ascii* is true (the default), the output is guaranteed to
    have all incoming non-ASCII characters escaped.  If *ensure_ascii* is
@@ -479,8 +478,8 @@ Encoders and Decoders
       object for *o*, or calls the base implementation (to raise a
       :exc:`TypeError`).
 
-      For example, to support arbitrary iterators, you could implement default
-      like this::
+      For example, to support arbitrary iterators, you could implement
+      :meth:`default` like this::
 
          def default(self, o):
             try:



More information about the Python-checkins mailing list