[Python-checkins] cpython (2.7): don't rely on dict order

benjamin.peterson python-checkins at python.org
Tue Feb 21 05:06:30 CET 2012


http://hg.python.org/cpython/rev/47232e4b73bc
changeset:   75111:47232e4b73bc
branch:      2.7
parent:      75108:e3fb353b3fd4
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Feb 20 23:06:22 2012 -0500
summary:
  don't rely on dict order

files:
  Lib/json/__init__.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -31,7 +31,7 @@
 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::

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list