mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
* 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.
This commit is contained in:
parent
81c0dcee65
commit
bcf6f92dc5
3 changed files with 47 additions and 22 deletions
|
@ -233,7 +233,7 @@ class JSONEncoder(object):
|
|||
|
||||
|
||||
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue