By: Mark Mruss
Iterators, iterables, and generators are features handled so wall by Python that people programming in other languages cannot help but drool over. Fortunately for us, creating iterators, iterables and generators is a relatively simple task. This article introduces the concepts of iterators, iterables, and generators and illustrates how easy it is to add them to your code.
- Iteration in Python
- An Initial Example
- Creating An Iterator
- Looking More Closely At The Iterator
- The Upside And Downside Of Iterators
- Looking Closely At The Generator
- But What About Iterables?
- Creating An Iterable Object