Skip to content

Commit a347bc0

Browse files
authored
Doc: Improve library/json document. (GH-24390)
1 parent 72fcd14 commit a347bc0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Doc/library/json.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Encoders and Decoders
333333
*object_hook*, if specified, will be called with the result of every JSON
334334
object decoded and its return value will be used in place of the given
335335
:class:`dict`. This can be used to provide custom deserializations (e.g. to
336-
support JSON-RPC class hinting).
336+
support `JSON-RPC <http://www.jsonrpc.org>`_ class hinting).
337337

338338
*object_pairs_hook*, if specified will be called with the result of every
339339
JSON object decoded with an ordered list of pairs. The return value of
@@ -422,10 +422,9 @@ Encoders and Decoders
422422
for ``o`` if possible, otherwise it should call the superclass implementation
423423
(to raise :exc:`TypeError`).
424424

425-
If *skipkeys* is false (the default), then it is a :exc:`TypeError` to
426-
attempt encoding of keys that are not :class:`str`, :class:`int`,
427-
:class:`float` or ``None``. If *skipkeys* is true, such items are simply
428-
skipped.
425+
If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when
426+
trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`
427+
or ``None``. If *skipkeys* is true, such items are simply skipped.
429428

430429
If *ensure_ascii* is true (the default), the output is guaranteed to
431430
have all incoming non-ASCII characters escaped. If *ensure_ascii* is
@@ -479,8 +478,8 @@ Encoders and Decoders
479478
object for *o*, or calls the base implementation (to raise a
480479
:exc:`TypeError`).
481480

482-
For example, to support arbitrary iterators, you could implement default
483-
like this::
481+
For example, to support arbitrary iterators, you could implement
482+
:meth:`default` like this::
484483

485484
def default(self, o):
486485
try:

0 commit comments

Comments
 (0)