generater
lazy, one-time use
PythonSpeed/PerformanceTips - Python Wiki
https://wiki.python.org/moin/PythonSpeed/PerformanceTips#Loops
Generator expressions were added to Python in version 2.4. They function more-or-less like list comprehensions or map operator but avoid the overhead of generating the entire list at once. Instead, they return a generator object which can be iterated over bit-by-bit:
code:python
iterator = (s.upper() for s in oldlist)
instead of
code:python
newlist = []
for word in oldlist:
newlist.append(word.upper())
Tips
How To Write Efficient Python Code: A Tutorial for Beginners - KDnuggets
Overusing list comprehensions and generator expressions in Python - Trey Hunner
https://treyhunner.com/2019/03/abusing-and-overusing-list-comprehensions-in-python/
See also
iterator
list comprehension