Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> How so?

When a concrete class registers with an ABC, it is making a promise that it 
implements everything in the ABC so that client code can count on all the 
methods being present.  That is the raison d'etre for abstract base classes.

In general, we restrict ABCs to a minimal useful subset of the capabilities of 
concrete classes.  That makes the ABC more broadly applicable and it makes life 
easier for implementers of concrete classes.  That's why collections.abc.Set 
doesn't include most of the named methods present in the concrete set/frozenset 
types.

Likewise, we don't want to add methods to already published ABCs because 
existing user classes registered to the ABC stop being compliant.  If an 
additional method is deemed essential, the technically correct way to do is to 
make a new ABC that subclasses from the old.  For example, that's why Python 2 
had to have both UserDict and IterableUserDict when we needed to add a 
__iter__() method.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue26680>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to