@@ -154,10 +154,6 @@ Basic Usage
154
154
:term: `file-like object `) using this :ref: `Python-to-JSON conversion table
155
155
<py-to-json-table>`.
156
156
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
-
161
157
.. note ::
162
158
163
159
Unlike :mod: `pickle ` and :mod: `marshal `, JSON is not a framed protocol,
@@ -197,6 +193,13 @@ Basic Usage
197
193
If ``True `` (the default), their JavaScript equivalents
198
194
(``NaN ``, ``Infinity ``, ``-Infinity ``) are used.
199
195
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
+
200
203
:param indent:
201
204
If a positive integer or string, JSON array elements and
202
205
object members will be pretty-printed with that indent level.
@@ -223,7 +226,7 @@ Basic Usage
223
226
If ``None `` (the default), :exc: `!TypeError ` is raised.
224
227
:type default: :term: `callable ` | None
225
228
226
- :param sort_keys:
229
+ :param bool sort_keys:
227
230
If ``True ``, dictionaries will be outputted sorted by key.
228
231
Default ``False ``.
229
232
0 commit comments