Message374464
FWIW, the relationship between a concrete class and an ABC is normative with respect to core capabilities but isn't 100% strict. Concrete classes can vary in small respects when it makes sense. For example, the __or__ and __and__ methods for collections.Set will accept any iterable, but the concrete does not.
We use the Liskov substitution principle as a guide, not as a law. In a number of cases, we choose practicality-beats-purity and allow subclasses to differ in ways than their parents. Counter() doesn't support fromkeys(). OrderedDict.popitem() has different signature than dict.popitem().
Hope that insight was helpful. |
|
Date |
User |
Action |
Args |
2020-07-28 05:14:44 | rhettinger | set | recipients:
+ rhettinger, Jim.Jewett, serhiy.storchaka, Akuli, pablogsal, ShubhamKJha, Yuan |
2020-07-28 05:14:44 | rhettinger | set | messageid: <1595913284.59.0.584861303055.issue41409@roundup.psfhosted.org> |
2020-07-28 05:14:44 | rhettinger | link | issue41409 messages |
2020-07-28 05:14:44 | rhettinger | create | |
|