Feature or enhancement
Proposal:
reprlib.Repr currently sorts dictionaries by key when producing representations. However, sometimes the insertion order is meaningful. It would be useful to have a sort_dicts parameter, analogous to the existing parameter in pprint.PrettyPrinter & friends.
I have already opened a thread under Ideas on discuss.python.org a couple days ago, but got no response (and therefore no objections *wink*).
The proposed API is:
orepr = reprlib.Repr(sort_dicts=False)
orepr(my_ordered_dict)
The default should remain True to preserve the existing behavior.
A possible implementation is here:
main...warden127:cpython:reprlib-sort_dicts
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Feature or enhancement
Proposal:
reprlib.Reprcurrently sorts dictionaries by key when producing representations. However, sometimes the insertion order is meaningful. It would be useful to have asort_dictsparameter, analogous to the existing parameter inpprint.PrettyPrinter& friends.I have already opened a thread under Ideas on discuss.python.org a couple days ago, but got no response (and therefore no objections *wink*).
The proposed API is:
The default should remain
Trueto preserve the existing behavior.A possible implementation is here:
main...warden127:cpython:reprlib-sort_dicts
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response