Chris Angelico firstname.lastname@example.org writes:
On Wed, Oct 21, 2015 at 8:56 AM, Carl Meyer email@example.com wrote: Sure, but a dictionary with a default handler _is_ a form of specialization - as is a dictionary that preserves order. Both of them behave absolutely identically to a regular dict when you set something, retrieve it, iterate over them, etc, etc, etc. She recommends a massive superclass that's capable of any form of injection; using inheritance allows the dict type to be broadly unaware of the modified dictionaries that exist.
Even considering that OrderedDict (or a _proper_ SortedDict - other languages' equivalent class doesn't require hashable keys because it stores items as a sorted list) requires a complete overhaul of how the dictionary stores items?
Really, from an implementation standpoint, it seems like a bad idea to even inherit in this case.