@@ -143,10 +143,6 @@ Basic Usage
143
143
:term: `file-like object `) using this :ref: `Python-to-JSON conversion table
144
144
<py-to-json-table>`.
145
145
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
-
150
146
.. note ::
151
147
152
148
Unlike :mod: `pickle ` and :mod: `marshal `, JSON is not a framed protocol,
@@ -186,6 +182,13 @@ Basic Usage
186
182
If ``True `` (the default), their JavaScript equivalents
187
183
(``NaN ``, ``Infinity ``, ``-Infinity ``) are used.
188
184
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
+
189
192
:param indent:
190
193
If a positive integer or string, JSON array elements and
191
194
object members will be pretty-printed with that indent level.
@@ -212,7 +215,7 @@ Basic Usage
212
215
If ``None `` (the default), :exc: `!TypeError ` is raised.
213
216
:type default: :term: `callable ` | None
214
217
215
- :param sort_keys:
218
+ :param bool sort_keys:
216
219
If ``True ``, dictionaries will be outputted sorted by key.
217
220
Default ``False ``.
218
221
0 commit comments