Generator expressions vs. list comprehensions
When should you use generator expressions and when should you use list comprehensions in Python?
# Generator expression
(x*2 for x in range(256))
# List comprehension
[x*2 for x in range(256)]
https://stackoverflow.com/questions/47789/generator-expressions-vs-list-comprehensions