logoalt Hacker News

sltkryesterday at 1:02 PM1 replyview on HN

So are dictionary keys, but Python decided to make them insertion ordered (after having them be unordered just like set elements for decades). There is no fundamental reason sets couldn't have a defined order. That's what languages like JavaScript have done too.


Replies

cpburns2009yesterday at 1:41 PM

Python's decision to make dict keys ordered in the spec was a mistake. It may be the best implementation so far, but it eliminates potential improvements in the future.

show 1 reply