@@ -237,6 +237,16 @@ Basic Usage
237237 If ``True ``, dictionaries will be outputted sorted by key.
238238 Default ``False ``.
239239
240+ .. note ::
241+
242+ Keys in key/value pairs of JSON are always of the type :class: `str `. When
243+ a dictionary is converted into JSON, all the keys of the dictionary are
244+ converted to strings. As a result of this, if a dictionary is converted
245+ into JSON and then back into a dictionary, the dictionary may not equal
246+ the original one. That is, ``loads(dumps(x)) != x `` if x has non-string
247+ keys. *sort_keys * sorts the keys before they are converted to strings,
248+ so numeric keys are sorted by value, not by their string representation.
249+
240250 .. versionchanged :: 3.2
241251 Allow strings for *indent * in addition to integers.
242252
@@ -256,17 +266,6 @@ Basic Usage
256266 table <py-to-json-table>`. The arguments have the same meaning as in
257267 :func: `dump `.
258268
259- .. note ::
260-
261- Keys in key/value pairs of JSON are always of the type :class: `str `. When
262- a dictionary is converted into JSON, all the keys of the dictionary are
263- coerced to strings. As a result of this, if a dictionary is converted
264- into JSON and then back into a dictionary, the dictionary may not equal
265- the original one. That is, ``loads(dumps(x)) != x `` if x has non-string
266- keys.
267- *sort_keys * sorts the keys before they are coerced to strings,
268- so numeric keys are sorted by value, not by their string representation.
269-
270269.. function :: load(fp, *, cls=None, object_hook=None, parse_float=None, \
271270 parse_int=None, parse_constant=None, \
272271 object_pairs_hook=None, **kw)
0 commit comments