[ the first of these makes use of tuple assignment to unpack row tuples in the listand the second uses indexing in python (but not in --see the note on argument unpacking in )map can use tuple unpacking on its argumenttoo only list(map((lambda (nameagejob)age)listoftuple)[ see other books and resources for more on python' database api besides the distinction between running functions versus expressionsthe biggest difference between map and list comprehensions in python is that map is an iterablegenerating results on demand to achieve the same memory economy and execution time divisionlist comprehensions must be coded as generator expressions-- major topic of this generator functions and expressions python today supports procrastination much more than it did in the past--it provides tools that produce results only when neededinstead of all at once we've seen this at work in built-in toolsfiles that read lines on requestand functions like map and zip that produce items on demand in such laziness isn' confined to python itselfthough in particulartwo language constructs delay result creation whenever possible in user-defined operationsgenerator functions (available since are coded as normal def statementsbut use yield statements to return results one at timesuspending and resuming their state between each generator expressions (available since are similar to the list comprehensions of the prior sectionbut they return an object that produces results on demand instead of building result list because neither constructs result list all at oncethey save memory space and allow computation time to be split across result requests as we'll seeboth of these ultimately perform their delayed-results magic by implementing the iteration protocol we studied in these features are not new (generator expressions were available as an option as early as python )and are fairly common in python code today python' notion of generators owes much to other programming languagesespecially icon though they may initially seem unusual if you're accustomed to simpler programming modelsyou'll probably find generators to be powerful tool where applicable moreoverbecause they are natural extension to the functioncomprehensionand iteration ideas we've generator functions and expressions