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.
This commit is contained in:
INADA Naoki 2018-07-07 08:55:03 +09:00 committed by GitHub
parent 0b75228700
commit e25399b40c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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: