3 ms·
Pretty sure they say NOT to rely on the ordered nature of the new dicts. So definitely not something you want to put in your tests.
by nicpottier 10y ago
Pretty sure they say NOT to rely on the ordered nature of the new dicts. So definitely not something you want to put in your tests.
- gsnedders 10y agoThe intention is to make the order guaranteed in 3.7 or 3.8, AIUI. There was some desire to prove the new implementation before guaranteeing its behaviours (i.e., in the worst case, if it turned out to be broken, they could revert to the 3.5 code and it would be valid).
- BozeWolf 10y agoNo it is in 3.6 already! It used to be not guaranteed. https://mail.python.org/pipermail/python-dev/2016-September/146327.html https://mail.python.org/pipermail/python-dev/2016-September/... But it is insertion order indeed, not sorting order.
- gsnedders 10y agoThe behaviour is there in CPython, yes. But the language documentation doesn't, deliberately.