This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients gvanrossum, rhettinger, serhiy.storchaka, stutzbach
Date 2017-03-05.19:02:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488740558.57.0.290330846489.issue29727@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think this is a bug.  The purpose collections.abc.Reversible is to recognize type where the behavior has been guaranteed, not to recognize all types where it happens to work.

Part of the original reason for introducing ABCs in the first place was that in general there is no reliable way to detect whether a class defining __getitem__ is a sequence or a mapping.

A creator of such a class either needs to subclass from Sequence or register as a Sequence.  The fact that reversed(Counter(10)) happens to work is no more interesting that the fact Counter(10)[5] happens to work eventhough isinstance(Counter, Sequence) returns False.
History
Date User Action Args
2017-03-05 19:02:38rhettingersetrecipients: + rhettinger, gvanrossum, stutzbach, serhiy.storchaka
2017-03-05 19:02:38rhettingersetmessageid: <1488740558.57.0.290330846489.issue29727@psf.upfronthosting.co.za>
2017-03-05 19:02:38rhettingerlinkissue29727 messages
2017-03-05 19:02:38rhettingercreate