Message400953
The docs need to clarify which ABCs can satisfy isinstance() based solely on hasattr() logic and which ABCs require registration or direct subclassing.
The docs should also explain why the more complex ABCs can't reliably be recognized based on the presence of desired method names.
One of the original motivating reasons for the ABCs was that the presence of __getitem__ was insufficient for determining whether a class was intended to be a Mapping or a Sequence. Accordingly, those classes have to subclass from an ABC or register with the ABC in order to declare intent. |
|
Date |
User |
Action |
Args |
2021-09-02 20:36:41 | rhettinger | set | recipients:
+ rhettinger, gvanrossum, docs@python, JelleZijlstra, kj, anuppari |
2021-09-02 20:36:41 | rhettinger | set | messageid: <1630615001.25.0.561092657074.issue45024@roundup.psfhosted.org> |
2021-09-02 20:36:41 | rhettinger | link | issue45024 messages |
2021-09-02 20:36:41 | rhettinger | create | |
|