@@ -154,10 +154,6 @@ Basic Usage
154154 :term: `file-like object `) using this :ref: `Python-to-JSON conversion table
155155 <py-to-json-table>`.
156156
157- To use a custom :class: `JSONEncoder ` subclass (for example, one that overrides the
158- :meth: `~JSONEncoder.default ` method to serialize additional types), specify it with the
159- *cls * keyword argument; otherwise :class: `JSONEncoder ` is used.
160-
161157 .. note ::
162158
163159 Unlike :mod: `pickle ` and :mod: `marshal `, JSON is not a framed protocol,
@@ -197,6 +193,13 @@ Basic Usage
197193 If ``True `` (the default), their JavaScript equivalents
198194 (``NaN ``, ``Infinity ``, ``-Infinity ``) are used.
199195
196+ :param cls:
197+ If set, a custom JSON encoder with the
198+ :meth: `~JSONEncoder.default ` method overridden,
199+ for serializing into custom datatypes.
200+ If ``None `` (the default), :class: `!JSONEncoder ` is used.
201+ :type cls: a :class: `JSONEncoder ` subclass
202+
200203 :param indent:
201204 If a positive integer or string, JSON array elements and
202205 object members will be pretty-printed with that indent level.
@@ -223,7 +226,7 @@ Basic Usage
223226 If ``None `` (the default), :exc: `!TypeError ` is raised.
224227 :type default: :term: `callable ` | None
225228
226- :param sort_keys:
229+ :param bool sort_keys:
227230 If ``True ``, dictionaries will be outputted sorted by key.
228231 Default ``False ``.
229232
0 commit comments