R. David Murray added the comment:

This is as designed.  The only method needed for something to qualify as an 
Iterable is __iter__, thus this is the only method defined on the ABC.  If you 
want your Iterable to be usable in a boolean test, add the __bool__ method to 
your concrete class.

In fact, you will note that no ABCs define __bool__.

Likewise __len__ is not part of being an Iterator, and in fact in the general 
case Iterators do not have a len (a given Iterator might be infinite, or it 
might not be practical to calculate the len).

----------
nosy: +r.david.murray
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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

Reply via email to