[issue25988] collections.abc.Indexable
Raymond Hettinger
report at bugs.python.org
Thu Jul 20 11:29:47 EDT 2017
Raymond Hettinger added the comment:
IIRC, the original motivation for ABCs was to differentiate distinct uses of __getitem__ (we forever struggled with differentiating sequences from mapping). It seems to me that this proposal is a step backwards. Other than a feeling of lightness, I don't think this proposal does anything for us. What is point of knowing an object is Subscriptable without knowing how it is to be used.
The OP has a sense that Mapping and Sequence are "too heavy" but I think the reality that useful classes almost never use __getitem__ in isolation; rather, it is part of a small constellation of methods that are typically used together. I would prefer that collections.abc continue to reflect that reality.
Also, I worry that collections.abc is becoming cluttered. The existence of use ABCs like MutableMapping is being drowned-out by one-trick-ponies. We're developing an unfavorable ratio of theoretical building blocks versus the practical tools.
----------
nosy: +rhettinger
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25988>
_______________________________________
More information about the Python-bugs-list
mailing list