#programming #language #python #functional
- Save more memory comparable to listcomp
- Can be used with Python Tuples, arrays and other sequences
- Save the cost to build a Python List
- The result can be saved as list, tuple, or dictionary
>>> symbols
>>> tuple (ord(symbol) for symbol in symbols)
(36, 162, 163, 165, 8364, 164)
>>> import array
>>> array.array ('I', (ord(symbol) for symbol in symbols))