4 Reasons Why You Should Be Using Python Generators

Generators in Python are more than just an alternative to lists

Jordan Williams
Better Programming
Published in
7 min readMar 9, 2021

--

Wind mills
Photo by Karsten Würth on Unsplash.

A generator is a construct in Python that allows for lazy or ad hoc loading of a stream of data. They can work like a list and be looped over, but generators have the ability to maintain state.

--

--

Enjoys creating software that make tasks simpler. Always trying to gain new knowledge and expertise.