>
This supports my point that this ought to be handled once, correctly, in
the standard library, like the other ABCs, instead of leaving it up to
people like me to get it wrong.
It would be pretty reasonable to assume that most users would get
this incorrectly. My first assumption to this problem would've been
something like ``hasattr(T, "__getitem__")``, but based on the current
comments, it seems like that would be inadequate for this
scenario. I'm not aware of any solution that would be remotely
intuitive to users.
>
(2) If not, is there any reason why we shouldn't add Subscriptable
to the collection.abc module? I think I have the implementation:
Another important question might be "would users utilize the
addition of Subscriptable in collections.abc enough for it to justify
its addition to the standard library?". I think it looks interesting,
but I think this should be implemented as a PyPI package (if
something similar hasn't been already) so that we can
evaluate it's usage rate before implementing it.
Raymond also brought up a strong point to consider in
> 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.