On Wed, Oct 06, 2021 at 11:17:07AM -0400, Eric V. Smith wrote:
I think we can rely on dicts being ordered as a language guarantee for the rest of time.
Indeed. That's official and documented. "Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6." https://docs.python.org/3/library/stdtypes.html#mapping-types-dict If we were ever to make them unordered again, that would be a breaking change that would need to go through a full deprecation process. Given how serious that would be, it would be a **LONG** deprecation process, so it wouldn't happen until at least Python 5000. We're more likely to add new, specialised mapping types which may not be ordered, rather than breaking that guarantee for dicts. And even that is unlikely unless there is a pressing need for them in the stdlib. -- Steve