Message401035
> 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. |
|
Date |
User |
Action |
Args |
2021-09-04 05:24:13 | steven.daprano | set | recipients:
+ steven.daprano, rhettinger, terry.reedy, serhiy.storchaka, mcarans |
2021-09-04 05:24:13 | steven.daprano | link | issue45093 messages |
2021-09-04 05:24:13 | steven.daprano | create | |
|