Hacker News new | ask | show | jobs
by BerislavLopac 2688 days ago
More importantly, in Python 3.7 this exception has become the rule, i.e. it was introduced in the language specification
1 comments

I am personally not a fan of details like this creeping into the language spec. CPython is not the only Python. This kind of spec creates unnecessary challenges for Micropython, for example. And of course there is Cython and others. It makes no sense to me that this should be in the language spec — you are essentially specifying a built in minefield of implementation bugs.
Cpython took this implementation detail from pypy (so it was already going to be the case in the two most used python implementations).

The reason being that the ordered dict ends up being faster than non-ordered, and people will rely on this implementation detail, so they added it to the spec to make that okay.