Skip to content

Glossary: Software Design Patterns

Generator

Also written: generators, yield

A function that uses `yield` to hand back one item, then pauses until the loop asks for the next. It is the easy way to write your own iterator.

Where the book teaches it

Related terms

Iterator