Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3e4852

Browse files
[3.12] Docs: amend json.dump() postgh-128482 (GH-128489) (#128494)
(cherry picked from commit87ee760)Co-authored-by: Erlend E. Aasland <erlend@python.org>
1 parent98d3f2b commite3e4852

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎Doc/library/json.rst

Lines changed: 8 additions & 5 deletions
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+
:paramboolsort_keys:
216219
If ``True``, dictionaries will be outputted sorted by key.
217220
Default ``False``.
218221

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp