Hacker News new | ask | show | jobs
by WhyNotHugo 651 days ago
Does dict now guarantee that it maintains order? IIRC, it was originally a mere side effect of the algorithm chosen (which was chosen for performance), but it could change in future releases or alternative implementations.
2 comments

>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#dict:~:text=....

afaik the documentation states that it could change in the future
Nope, "Dict keeps insertion order" is the ruling.

https://mail.python.org/pipermail/python-dev/2017-December/1...