[docs] [issue17887] docs: summary page - generator vs iterator vs iterable
Terry J. Reedy
report at bugs.python.org
Sat May 4 01:42:01 CEST 2013
Terry J. Reedy added the comment:
Briefly,
An iterable is an object that can be iterated with an iterator.
An iterator is an iterable that responds to next() calls, including the implicit calls in a for statement.
A generator is an iterator created by a generator function, which is a function with a yield keyword in its body.
A sequence is an iterable with minimal sequence methods.
The four terms are all in the glossary. The entry for iterable already points to the other three. What do you think is missing?
A range (as documented) is an immutable sequence.
----------
nosy: +terry.reedy
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17887>
_______________________________________
More information about the docs
mailing list