[Python-Dev] PEP 372 -- Adding an ordered directory to collectionsready for pronouncement

Raymond Hettinger python at rcn.com
Mon Mar 2 18:39:49 CET 2009


[Antoine Pitrou]
> You seem to imply that it is more important for __eq__ to work intuitively
> between a non-OrderedDict and an OrderedDict, than it is to work intuitively
> between two OrderedDicts.

Yes.  When Armin and I worked through this, it became clear that
he had multiple use cases where ordered dicts needed to be used
in places that had been originally designed to expect regular dicts.
That was also the reason for subclassing dict.  Otherwise, we would
have just made a standalone class that defined all the mapping methods.

I don't think we going to convince you and that's okay.  We don't
have to agree on every design decision.  There were some reasons
for either approach and we picked the one that best fit Armin's use
cases, that was simplest, that introduced the fewest special rules,
and did not create a Liskov violation.  The choice was clearly
documented and an alternative was provided for people that
needed it.

Outside of your differing judgment on the __eq__ method, are you
basically happy with the ordered dict PEP?


Raymond






More information about the Python-Dev mailing list