| ▲ | BiteCode_dev 2 days ago | |
Ordering is very useful for testing. This morning for example, I tested an object serialized through a JSON API. My test data seems to never match the next run. After a while, I realized one of the objects was using a set of objects, which in the API was turned into a JSON array, but the order of said array would change depending of the initial Python VM state. 3 days ago, I used itertools.group by to group a bunch of things. But itertools.group by only works on iterable that are sorted by the grouping key. Now granted, none of those recent example are related to dicts, but dict is not a special case. And it's iterated over regularly. | ||