Vedran Čačić added the comment:

Raymond, I think you didn't understand the issue. Glossary already _has_ the 
ammendment you mention (at least for the __getitem__ - I'm not sure any of 
other examples you mention are counterexamples to that interpretation: 
callable_iterators and generators _do_ have an __iter__ attribute, and they are 
correctly detected as instances of collections.abc.Iterable).

I wanted to push in the _opposite_ direction, to fully bless __getitem__ as a 
way to declare iterability, so it could be recognized by Iterable's 
instancecheck. Because it seems to me that whoever wrote that instancecheck, 
didn't have the _intention_ to exclude __getitem__ iteration.

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".

----------

_______________________________________
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