Python language

Generator

A function using yield, producing values lazily and holding its state between calls.

Why interviewers ask about it

The memory argument is the point: constant memory regardless of length, which is how you stream a file larger than RAM. The trade is single-consumption and no indexing.

This term is part of the free Python Full-Stack interview preparation module - browse the full glossary for every definition.