Generators
suggest changeIntroduction
Generators are lazy iterators created by generator functions (using yield
) or generator expressions (using (an_expression for x in an_iterator)
).
Syntax
- yield
<expr>
- yield from
<expr>
<var>
= yield<expr>
- next(
<iter>
)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents