mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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:
parent
0b75228700
commit
e25399b40c
1 changed files with 1 additions and 1 deletions
|
@ -350,7 +350,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
|
||||||
item_separator = _item_separator
|
item_separator = _item_separator
|
||||||
first = True
|
first = True
|
||||||
if _sort_keys:
|
if _sort_keys:
|
||||||
items = sorted(dct.items(), key=lambda kv: kv[0])
|
items = sorted(dct.items())
|
||||||
else:
|
else:
|
||||||
items = dct.items()
|
items = dct.items()
|
||||||
for key, value in items:
|
for key, value in items:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue