summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-17 00:41:15 -0700
committerSenthil Kumaran <senthil@uthcode.com>2012-03-17 00:41:15 -0700
commit8df2634a7ea3fadbea1bdef06bd748ef30b4bb9f (patch)
tree36e10f344fcd0e2d5316e8b7b273c9fe6b87c1df
parentbc8e81dcc32b42164fe158f1daf91ac93426efbf (diff)
parentf2123d2db54d661a016f02c5a1a02484d6d79e0d (diff)
downloadcpython-git-8df2634a7ea3fadbea1bdef06bd748ef30b4bb9f.tar.gz
merge from 3.2 - issue6566
-rw-r--r--Doc/library/json.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index a791259831..f656700887 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -168,6 +168,14 @@ Basic Usage
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)