diff Lib/json/encoder.py @ 54373:22fd967518ee

* Fix-up a TODO (support the sort_key option). * Fix an error where True/False were being written-out as title-cased strings when used a dictionary keys. * Speed-up iteration over dicts by looping over items() rather than keys() followed by value lookups. * TODO: sort only by keys, not keys and values.
author Raymond Hettinger <python@rcn.com>
date Wed, 27 May 2009 09:58:34 +0000
parents f686aced02a3
children aa19a7cc1bf3
line wrap: on
line diff
--- a/Lib/json/encoder.py	Wed May 27 09:12:18 2009 +0000
+++ b/Lib/json/encoder.py	Wed May 27 09:58:34 2009 +0000
@@ -233,7 +233,7 @@
 
 
         if (_one_shot and c_make_encoder is not None
-                and not self.indent and not self.sort_keys):
+                and not self.indent):
             _iterencode = c_make_encoder(
                 markers, self.default, _encoder, self.indent,
                 self.key_separator, self.item_separator, self.sort_keys,