Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8df2634

Browse files
committed
merge from 3.2 - issue6566
2 parents bc8e81d + f2123d2 commit 8df2634

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Doc/library/json.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ Basic Usage
168168
so trying to serialize multiple objects with repeated calls to
169169
:func:`dump` using the same *fp* will result in an invalid JSON file.
170170

171+
.. note::
172+
173+
Keys in key/value pairs of JSON are always of the type :class:`str`. When
174+
a dictionary is converted into JSON, all the keys of the dictionary are
175+
coerced to strings. As a result of this, if a dictionary is convered
176+
into JSON and then back into a dictionary, the dictionary may not equal
177+
the original one. That is, ``loads(dumps(x)) != x`` if x has non-string
178+
keys.
171179

172180
.. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
173181

0 commit comments

Comments
 (0)