On Jan 19, 2014 6:49 PM, "Keith Winston" <keithw...@gmail.com> wrote: > > Well, as usual thanks for all this, it's really great. I'd worked out > that it was a distinction between iterators and iterables, though I'm > going to Oscar's description a few more times: most of it made sense, > but there are subtleties. > > For example, this from the Python 3.3 tutorial: > > We say such an object is iterable [referring to "range"], that is, > suitable as a target for functions and constructs that expect > something from which they can obtain successive items until the supply > is exhausted. We have seen that the for statement is such an iterator. > The function list() is another; it creates lists from iterables: > > Now, everything we've said thus far would not have led me to believe > that one would call the for statement an iterator... is this just > very, very loose use of the term (in the Python documentation!), or am > I still missing something biggish?
I think that's just an editing mistake. If you replace the word "iterator" with "construct" then it makes sense: We have seen that the for statement is such a construct. Oscar
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor