-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Functional Python Programming, 3rd edition
By :

We’ll now look at ways to apply generator expressions to a number of Python’s built-in collections. This section will cover the following topics:
Generators for lists, dicts, and sets
Working with stateful collections
Using the bisect
module to create a mapping
Using stateful sets
Each of these looks at some specialized cases of Python collections and generator functions. In particular, we’ll look at ways to produce a collection, and consume the collection in later processing.
This is a lead-in to the next chapter, Chapter 4, Working with Collections, which covers the Python collections in considerably more detail.
A Python sequence object, such as a list, is iterable. However, it has some additional features. We can think of a list as a materialized iterable. We’ve used the tuple()
function in several examples to collect the output of a generator expression...