Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon"

FWIW https://docs.python.org/3/whatsnew/3.7.html

> the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec.

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

There's a big difference between "iteration order is deterministic" and "iteration order is <very specific high-level behaviour>" even if the latter is a side-effect of an implementation details. In particular, iteration order being either insertion order or sorted are useful and sought-after properties, while other implementation-dependent deterministic orderings are mostly implicit dependencies and sources of bugs (not unlike e.g. the scheduling sequence of goroutines in Go).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: