]> granicus.if.org Git - python/commitdiff
Let's sort the keys so that this test passes even with random hashes.
authorBarry Warsaw <barry@python.org>
Tue, 21 Feb 2012 15:22:34 +0000 (10:22 -0500)
committerBarry Warsaw <barry@python.org>
Tue, 21 Feb 2012 15:22:34 +0000 (10:22 -0500)
Lib/json/__init__.py

index 56116f482f1b59d95fe8b79945168ee5cb49617e..b2fae9d32e401543e5326806a97dbd26c96da01f 100644 (file)
@@ -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)::