A little pocket reference on iterables, iterators and generators. Occasionally I've run into situations of confusion on the exact differences between the following related concepts in Python: a container an iterable an iterator a generator a generator expression a {list, set, dict} comprehension I'm writing this post as a pocket reference for later. Containers ¶ Containers are data structures hold
![Iterables vs. Iterators vs. Generators](https://cdn-ak-scissors.b.st-hatena.com/image/square/11ef66c4a09ba664b7feee34b730c82ae2821244/height=288;version=1;width=512/http%3A%2F%2Fnvie.com%2Fimg%2Frelationships.png)