December 2022
Beginner
576 pages
11h 19m
English
Functional programming emphasizes stateless algorithms. In Python, this leads us to work with generator expressions, generator functions, and iterables. In this chapter, we’ll continue our study of the itertools library, with numerous functions to help us work with iterable collections.
In the previous chapter, we looked at three broad groupings of iterator functions. They are as follows:
Functions that work with infinite iterators, which can be applied to any iterable or an iterator over any collection; they consume the entire source
Functions that work with finite iterators, which can either accumulate a source multiple times, or produce a reduction of the source
The tee() iterator ...
Read now
Unlock full access