3 ms·
EDIT: I was just informed it is as of 3.7 an official language feature, making everything below invalid Personally, I'm worried people will come to rely on the
by ATsch 9y ago
EDIT: I was just informed it is as of 3.7 an official language feature, making everything below invalid
Personally, I'm worried people will come to rely on the new behaviour in code instead. As core developers have repeatedly said, dict order is still an implementation detail, it should not be relied on as it
is not officially part of the language. Other implementations (except pypy) will probably not have this behaviour.
Yet, I feel like this will fall on deaf ears and become a de-facto part of the language. Blogs will state it as a new feature, Python books will teach it and new coders will rely on it, forever locking the dict internals in place for all python interpreters.
(If you need to rely on ordering, use an OrderedDict instead.)