On Sat, May 29, 2021 at 6:01 PM Chris Angelico
But if you're okay with constructing a new dict, you can do this:
d = dict(sorted(d.items(), key=lambda kv: ...))
Or to keep the same dict (not tested)
tmp = list(sorted(d.items()))
d.clear()
d.update(tmp)
--
Jonathan