On 29/04/17 23:40, Ned Batchelder wrote:
For creating your own class that acts like
a dict, you should derive from collections.abc.MutableMapping, which
only requires implementing __getitem__, __setitem__, __delitem__,
__iter__, and __len__.

Or, I could derive from collections.OrderedDict and just implement the two methods that I actually want to change the behavior of (did you read the rest of my post?) ;)

That's one of the points I'm trying to make - why is it harder than it needs to be to do something this simple?

The other is that the documentation of collections.OrderedDict seems to be lacking (it is talking in terms of being a "dict" subclass, but it actually isn't one).

E.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to