[docs] [issue26019] collections.abc documentation incomplete

Andrew Barnert report at bugs.python.org
Tue Jan 5 21:05:12 EST 2016

New submission from Andrew Barnert:

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.

assignee: docs at python
components: Documentation
messages: 257577
nosy: abarnert, docs at python
priority: normal
severity: normal
status: open
title: collections.abc documentation incomplete
type: enhancement
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the docs mailing list