diff options
Diffstat (limited to 'Doc/library/json.rst')
-rw-r--r-- | Doc/library/json.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 79430c3..9f1ebc2 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -17,13 +17,13 @@ Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' - >>> print json.dumps("\"foo\bar") + >>> print(json.dumps("\"foo\bar")) "\"foo\bar" - >>> print json.dumps(u'\u1234') + >>> print(json.dumps(u'\u1234')) "\u1234" - >>> print json.dumps('\\') + >>> print(json.dumps('\\')) "\\" - >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) + >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from StringIO import StringIO >>> io = StringIO() @@ -40,7 +40,7 @@ Compact encoding:: Pretty printing:: >>> import json - >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) + >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 |