What is a generator?
A generator yields values lazily so you can stream work instead of building the whole collection at once.
- Uses yield
- Keeps state between iterations
- Good for large data
What is a generator?
A generator yields values lazily so you can stream work instead of building the whole collection at once.
A generator yields values lazily so you can stream work instead of building the whole collection at once.
What is a generator?