post
Python idioms I reach for daily, part 3: generators for streaming and composition
Final part of the series. Generators turn an O(N) memory problem into an O(1) memory problem and let you compose pipelines that read like sentences. Five patterns: streaming files, paginated APIs, itertools chains, batching, and async generators.