[Python-Dev] Terminology of "Iterable" and "Iterator"

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Jul 26 04:11:46 CEST 2007


Raymond Hettinger wrote:
> In the case of iter(collection), I prefer the current wording because the target object need not support __iter__, it is sufficient 
> to supply a sequential __getitem__ method.

Seems to me that should be included in the definition of
an iterable -- i.e. anything for which iter() works is
an iterable.

--
Greg


More information about the Python-Dev mailing list