On 22Sep2018 12:08, Brian Oney <brian.j.o...@googlemail.com> wrote:
That's one thing that confused me. Generators are supposed to be one-off iterators. Iterators, *I understood* as reusable iterables.
You've misread the grammar (the semantics). Iterators are one off - they're something that counts (for want of a better word which isn't "iterates") though something.
An _iterable_ is something which can be iterated over, and therefore is something from which an iterator can be made to do that.
So an iterator is what does the iterating, a single pass over whatever it is. An iterable is something you can iterate over, using an iterator. Cheers, Cameron Simpson <c...@cskk.id.au> -- https://mail.python.org/mailman/listinfo/python-list