Skip to content

Commit e3e4852

Browse files
[3.12] Docs: amend json.dump() post gh-128482 (GH-128489) (#128494)
(cherry picked from commit 87ee760) Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 98d3f2b commit e3e4852

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Doc/library/json.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ Basic Usage
143143
:term:`file-like object`) using this :ref:`Python-to-JSON conversion table
144144
<py-to-json-table>`.
145145

146-
To use a custom :class:`JSONEncoder` subclass (for example, one that overrides the
147-
:meth:`~JSONEncoder.default` method to serialize additional types), specify it with the
148-
*cls* keyword argument; otherwise :class:`JSONEncoder` is used.
149-
150146
.. note::
151147

152148
Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol,
@@ -186,6 +182,13 @@ Basic Usage
186182
If ``True`` (the default), their JavaScript equivalents
187183
(``NaN``, ``Infinity``, ``-Infinity``) are used.
188184

185+
:param cls:
186+
If set, a custom JSON encoder with the
187+
:meth:`~JSONEncoder.default` method overridden,
188+
for serializing into custom datatypes.
189+
If ``None`` (the default), :class:`!JSONEncoder` is used.
190+
:type cls: a :class:`JSONEncoder` subclass
191+
189192
:param indent:
190193
If a positive integer or string, JSON array elements and
191194
object members will be pretty-printed with that indent level.
@@ -212,7 +215,7 @@ Basic Usage
212215
If ``None`` (the default), :exc:`!TypeError` is raised.
213216
:type default: :term:`callable` | None
214217

215-
:param sort_keys:
218+
:param bool sort_keys:
216219
If ``True``, dictionaries will be outputted sorted by key.
217220
Default ``False``.
218221

0 commit comments

Comments
 (0)