diff options
author | Barry Warsaw <barry@python.org> | 2012-02-21 10:22:34 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-02-21 10:22:34 -0500 |
commit | b69fa1f8b7b935c79b193502358bd59b685afd77 (patch) | |
tree | c6777a7439ac5c109668ad6de259e96dd740e985 /Lib | |
parent | b19fb2462eac776746f6cb40cc84b0587c83b9bc (diff) | |
download | cpython-git-b69fa1f8b7b935c79b193502358bd59b685afd77.tar.gz |
Let's sort the keys so that this test passes even with random hashes.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/json/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index 56116f482f..b2fae9d32e 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -29,7 +29,7 @@ Encoding basic Python object hierarchies:: Compact encoding:: >>> import json - >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) + >>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing (using repr() because of extraneous whitespace in the output):: |