Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
> Another case is in round trip processing of JSON or YML. Sorry for my ignorance, but I don't see how or why an unordered comparison would help you with round-tripping JSON or YAML. The order of key:value pairs in JSON is not guaranteed to be preserved, so if you round-trip a dict to JSON back to a dict, and then use an ordered comparison, you might wrongly think that they are unequal. (I think that Python's JSON does preserve order, by default. But other JSON encoders might not.) > Other cases are where you would prefer an OrderedDict over a dict. Then use an OrderedDict. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45093> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com