|
|
|
|
|
by bostik
2917 days ago
|
|
> Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.) That is a terrible decision. Call me a heretic. Yes, I know it's a side effect of bringing in the bitmap index version from PyPy. Yes, I am aware that collections.OrderedDict is now an alias to internal dictionary type. And yes, I do understand that randomising the key traversal order could incur a performance penalty. But a dictionary where keys come out in anything other than unspecified order is a subtle trap just waiting to blow up. I personally prefer golang's map behaviour - keys are always in unspecified order, and the order is different even between calls. |
|
[#]: Well, usually it doesn’t matter, and when it does, you have other ways to achieve similar results.