Iteration
suggest changeA generator object supports the iterator protocol. That is, it provides __next__(), which the built-in next() calls to step through its execution, and its __iter__ method returns itself. This means that a generator can be used in any language construct which supports generic iterable objects.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents