[docs] [issue18558] Iterable glossary entry needs clarification

R. David Murray report at bugs.python.org
Mon Jul 17 08:51:48 EDT 2017


R. David Murray added the comment:

No, refusing to guess in this case is to believe the class's declaration that it is an iterable if (and only if) it defines __iter__, which is the modern definition of iterable.  If that doesn't work when the object is iterated, that's a bug in the class claiming to be an iterable when it isn't.

The confusion here is the existence of the older iteration protocol.  As you say, the documentation can use some improvement.  Eventually someone will submit a proposal in the form of a PR and we can hammer out the exact wording.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18558>
_______________________________________


More information about the docs mailing list