(original) (raw)
changeset: 75779:0554183066b5 parent: 75776:66803fd0a6bc parent: 75778:613919591a05 user: Senthil Kumaran senthil@uthcode.com date: Sat Mar 17 00:41:15 2012 -0700 description: merge from 3.2 - issue6566 diff -r 66803fd0a6bc -r 0554183066b5 Doc/library/json.rst --- a/Doc/library/json.rst Sat Mar 17 00:24:09 2012 -0700 +++ b/Doc/library/json.rst Sat Mar 17 00:41:15 2012 -0700 @@ -168,6 +168,14 @@ so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file. + .. note:: + + Keys in key/value pairs of JSON are always of the type :class:`str`. When + a dictionary is converted into JSON, all the keys of the dictionary are + coerced to strings. As a result of this, if a dictionary is convered + into JSON and then back into a dictionary, the dictionary may not equal + the original one. That is, ``loads(dumps(x)) != x`` if x has non-string + keys. .. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw) /senthil@uthcode.com