Author rhettinger
Recipients Austin Bingham, christian.heimes, gvanrossum, mark.dickinson, rhettinger, robert_smallshire, serhiy.storchaka, tim.peters
Date 2020-10-04.18:43:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601837019.52.0.878408411694.issue26680@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2020-10-04 18:43:39rhettingersetrecipients: + rhettinger, gvanrossum, tim.peters, mark.dickinson, christian.heimes, serhiy.storchaka, robert_smallshire, Austin Bingham
2020-10-04 18:43:39rhettingersetmessageid: <1601837019.52.0.878408411694.issue26680@roundup.psfhosted.org>
2020-10-04 18:43:39rhettingerlinkissue26680 messages
2020-10-04 18:43:39rhettingercreate