Skip to content

Commit 1a71527

Browse files
committed
gh-137533:fix the note in json.dump()
1 parent a4b8240 commit 1a71527

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Doc/library/json.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,10 @@ Basic Usage
261261

262262
.. note::
263263

264-
Keys in key/value pairs of JSON are always of the type :class:`str`. When
265-
a dictionary is converted into JSON, all the keys of the dictionary are
266-
coerced to strings. As a result of this, if a dictionary is converted
267-
into JSON and then back into a dictionary, the dictionary may not equal
268-
the original one. That is, ``loads(dumps(x)) != x`` if x has non-string
269-
keys.
264+
The encoder will convert all non-string keys in dictionaries into string,
265+
if a dictionary is converted into JSON and then back into a dictionary,
266+
the dictionary may not equal the original one.
267+
That is, ``loads(dumps(x)) != x`` if x has non-string keys.
270268

271269
.. function:: load(fp, *, cls=None, object_hook=None, parse_float=None, \
272270
parse_int=None, parse_constant=None, \

0 commit comments

Comments
 (0)