Python Generator
Noun · Development
Definitions
A function that uses the yield keyword to produce a sequence of values lazily, suspending its execution state between each yield and resuming on the next iteration. Generators return an iterator object and consume memory proportional to their state rather than the full sequence length.
In plain English: A special Python function that produces values one at a time on demand, instead of computing everything at once and stuffing it all into memory.
Example: "We replaced the list comprehension with a generator so we could stream 10 million rows without blowing up memory."