[issue18558] Iterable glossary entry needs clarification

Terry J. Reedy report at bugs.python.org
Sat Jul 27 01:28:20 CEST 2013


Terry J. Reedy added the comment:

Stephen, your class, or rather instances thereof when initialized with a sequence, follow the old iteration protocol. You might call them iterators in the generic sense, though I cannot remember whether we used 'iterator' much before the introduction of the new and now dominant iteration protocol. I am sure 'iterable' was introduced with the new protocol for objects with .__iter__ methods that return iterators, which in this context means an object with a .__next__ method and excludes .__getitem__ objects.

It would have been less confusing is we had disabled the old protocol in 3.0, but aside from the predictable confusion, it seemed better to keep it.

----------
nosy: +terry.reedy

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


More information about the Python-bugs-list mailing list