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 abarnert
Recipients abarnert, docs@python
Date 2016-01-06.02:05:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452045912.74.0.509683701942.issue26019@psf.upfronthosting.co.za>
In-reply-to
Content
Some of the modules in collections.abc have a subclass hook that implicitly registers any type that declares the right methods, like Iterator. Others do not, like Sequence. For those that do have the hook, it's not always obvious what methods are tested. And some of them test the methods for truthiness, others only for existence (although #25958 will fix that last bit).

The documentation doesn't even mention this, much less describe which ABCs are of which kind.

For someone who just wants to know how to write isinstance(arg, Iterable), that's fine. But anyone who wants to create new classes, or integrate third-party classes that weren't ABC-friendly, has to read the collections.abc module source to figure out what they want to do.
History
Date User Action Args
2016-01-06 02:05:12abarnertsetrecipients: + abarnert, docs@python
2016-01-06 02:05:12abarnertsetmessageid: <1452045912.74.0.509683701942.issue26019@psf.upfronthosting.co.za>
2016-01-06 02:05:12abarnertlinkissue26019 messages
2016-01-06 02:05:11abarnertcreate