From e25399b40cd15620e77c9ad2ed24549006ae9b47 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sat, 7 Jul 2018 08:55:03 +0900 Subject: [PATCH] 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. --- Lib/json/encoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py index fb083ed61bb..2d7b8989c71 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: