| ▲ | sltkr 2 days ago | |||||||
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. | ||||||||
| ▲ | cpburns2009 2 days ago | parent [-] | |||||||
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. | ||||||||
| ||||||||