Open
Description
It is documented as:
.. function:: sortdict(dict)
Return a repr of *dict* with keys sorted.
Here's what it does:
cpython/Lib/test/support/__init__.py
Lines 624 to 629 in 6b9babf
But, since python3.7 (?) dicts are sorted.
Here's the list of its usages:
» ag sortdict
Misc/HISTORY
24694: sortdict(dict) function for a simple way to display a dict in sorted
Lib/test/test_support.py
311: def test_sortdict(self):
312: self.assertEqual(support.sortdict({3:3, 2:2, 1:1}), "{1: 1, 2: 2, 3: 3}")
Lib/test/test_descrtut.py
11:from test.support import sortdict
62: >>> print(sortdict(a)) # show the result
99: >>> print(sortdict(a.__dict__))
Lib/test/test_pyexpat.py
16:from test.support import sortdict
93: sortdict(attrs))
Lib/test/support/__init__.py
61: "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict",
624:def sortdict(dict):
Lib/test/test_extcall.py
16: ... print(a, support.sortdict(k))
19: ... print(x, y, support.sortdict(z))
Doc/library/test.rst
486:.. function:: sortdict(dict)
So, the question is: do we still need it? For backward compat or something.
If not, I can send a PR with its removal.