⚠️ Version 2 iterators differ substantially from version 1.
This is a description of iterators from version 1, which tracked an earlier
version of the ECMAScript iterator proposal.
An iterator is an object with a next method that returns the next value for
the iterator, or throws StopIteration, a global sentinel object for all
ReturnValue is a global constructor for instances that inherit from
StopIteration used to stop an iterator with a return value, particularly
useful for generators.
The iterator module shims these globals if they do not already exist.
An iterable is an object that implements iterator.
Collections that implement iterator may return either an iterator or an
Iterator supports additional methods beyond next.