From f093724845db20c902ff0272115f949b7d05bb40 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 20 Feb 2012 23:06:22 -0500 Subject: [PATCH] don't rely on dict order --- Lib/json/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index 414c702629c..ccbe9f465f7 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -31,7 +31,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::