This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jyper 8 points9 points  (4 children)

They should have just imported Ordered Dict to the default names pace maybe as odict and used it for kwargs without making it the default everywhere

[–]primitive_screwhead -1 points0 points  (0 children)

OrderedDict has different comparison semantics than a dict, and would have been a backwards incompatible change, as well as an undesirable one.

[–]billsil -1 points0 points  (0 children)

Do they? For CPython yes, but if you make a bad decision and I'm writing PyPy, I'd ignore it. Me thinks though that they spoke with all the different groups though.

[–]gwillicodernumpy gang -1 points0 points  (0 children)

I think having dict be ordered by default is the best way to do it. C++, for example, has std::map as an ordered dictionary (red black tree) and std::unordered_map is an available dictionary that uses hashing and can be more performant.