Raymond Hettinger added the comment:

> Or at least, if we cannot do that because of backward
> compatibility:-(, to explicitly document that Iterable ABC
> _does not_ fully encompass what we mean by "being iterable".

That would be a reasonable amendment to collections.abc.Iterable docs.

I don't think it is either desirable or possible for collections.abc.Iterable 
to recognize iterables with __getitem__.  We cannot know it advance whether 
__getitem__ is a mapping or a sequence.  IIRC, that particular problem was the 
motivation for creating the ABCs. Without a user registering a class as 
Iterable or without inheriting from Iterable, there is really no way to know.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18558>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to