Generators
Generators and yield
yield
If a function uses the yield
keyword, it defines an object known as a generator.
The primary use of a generator is to produce values for use in iteration. Here's an example:
Restartable Generators
Generator Delegation
Using Generators in Practice
Enhanced Generators and yield
Expressions
yield
ExpressionsApplications of Enhanced Generators
Generators and the Bridge to Awaiting
Last updated