diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-07-06 23:55:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 23:55:03 (GMT) |
commit | e25399b40cd15620e77c9ad2ed24549006ae9b47 (patch) | |
tree | 709a482dc1dff2ae20133b276dc852235054c185 /Lib/json | |
parent | 0b75228700e0077d8bf2636e74733389514b4b2f (diff) | |
download | cpython-e25399b40cd15620e77c9ad2ed24549006ae9b47.zip cpython-e25399b40cd15620e77c9ad2ed24549006ae9b47.tar.gz cpython-e25399b40cd15620e77c9ad2ed24549006ae9b47.tar.bz2 |
bpo-23493: json: Change sort_keys in Python encoder same to C (GH-8131)
Stop using key=lambda. This behavior is same to C version encoder.
Diffstat (limited to 'Lib/json')
-rw-r--r-- | Lib/json/encoder.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py index fb083ed..2d7b898 100644 --- a/Lib/json/encoder.py +++ b/Lib/json/encoder.py @@ -350,7 +350,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, item_separator = _item_separator first = True if _sort_keys: - items = sorted(dct.items(), key=lambda kv: kv[0]) + items = sorted(dct.items()) else: items = dct.items() for key, value in items: |