According to PEP 468:
Starting in version 3.6 Python will preserve the order of keyword arguments as passed to a function. To accomplish this the coll
"Ordered mapping" only means the mapping has to preserve order. It doesn't mean that order has to be part of the mapping's ==
relation.
The purpose of PEP 468 is just to preserve the ordering information. Having order be part of ==
would produce backward incompatibility without any real benefit to any of the use cases that motivated PEP 468. Using OrderedDict
would also be more expensive (since OrderedDict
still maintains its own separate linked list to track order, and it can't abandon that linked list without sacrificing big-O efficiency in popitem
and move_to_end
).