|
|
|
|
|
by nerdponx
1404 days ago
|
|
The problem with Python here is that CPython is not only the reference implementation but the de-facto specification. So dicts are still "supposed to be" unordered collections, but now dicts must also preserve insertion order as per the docs and the reference implementation, so now all alternative implementations must also conform to this even if it doesn't make sense for them to conform to it, or they must specifically choose to be non-comformant on this point. Of course in this case, the order-preserving optimization was actually first implemented by an alternative implementation (PyPY), but I don't think that changes the issue. |
|
"the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec."
https://docs.python.org/3/whatsnew/3.7.html