Hashable mappings
Hashable mappings
Posted Dec 6, 2025 5:23 UTC (Sat) by iabervon (subscriber, #722)In reply to: Hashable mappings by AdamW
Parent article: A "frozen" dictionary for Python
The history is that the iterator order used to be unpredictable, so the same object might give different orders when traversed multiple times and objects constructed by adding the items in different order might give the same order when traversed multiple times. However, a more recent implementation of dict started to traverse the items in the order the keys were first added, just because that was more convenient, and then the language changed to guarantee this. Of course, that meant that there was now something you could reliably determine about dicts that wasn't included in the equality rules that had always existed.
