[Python-ideas] Adding collections.abc.Ordered

Andrew Barnert abarnert at yahoo.com
Sat Dec 26 18:34:25 EST 2015


On Dec 26, 2015, at 15:05, Guido van Rossum <guido at python.org> wrote:
> 
> There is a precedent for declaring that a method isn't implemented: __hash__. The convention is to set it to None in the subclass that explicitly doesn't want to implement it. The __subclasshook__ in collections.Hashable checks for this. The pattern is also used for __await__.

Well, that makes things a lot simpler.

But getting back to Serhiy's point: would a `collections.abc.Reversible` (with this fix) solve the need for Ordered, and, if so, should it be added?



More information about the Python-ideas mailing list