[ list( for in ( )[ nonfunction case simpler as generatorthe same holds true for text-processing use cases like the join call we saw earlier-- list comprehension makes an extra temporary list of resultswhich is completely pointless in this context because the list is not retainedand map loses simplicity points compared to generator expression syntax when the operation being applied is not callline 'aaa,bbb,ccc'join([ upper(for in line split(',')]'aaabbbccc'join( upper(for in line split(',')'aaabbbccc'join(map(str upperline split(','))'aaabbbccc'join( for in line split(',')'aaaaaabbbbbbcccccc'join(map(lambda xx line split(','))'aaaaaabbbbbbccccccmakes pointless list generates results generates results simpler as generatorboth map and generator expressions can also be arbitrarily nestedwhich supports general use in programsand requires list call or other iteration context to start the process of producing results for examplethe list comprehension in the following produces the same result as the map and generator equivalents that follow itbut makes two physical liststhe others generate just one integer at time with nested generatorsand the generator expression form may more clearly reflect its intent[ for in [abs(xfor in (- - )][ nested comprehensions list(map(lambda xx map(abs(- - )))[ nested maps list( for in (abs(xfor in (- - ))[ nested generators although the effect of all three of these is to combine operationsthe generators do so without making multiple temporary lists in xthe next example both nests and combines generators--the nested generator expression is activated by mapwhich in turn is only activated by list import math list(map(math sqrt( * for in range( )))[ nested combinations technically speakingthe range on the right in the preceding is value generator in tooactivated by the generator expression itself--three levels of value generationwhich produce individual values from inner to outer only on requestand which "just works comprehensions and generations