7.7. Lazy Iteration¶
We have already seen some Python expressions that exhibit lazy evaluation,
including range
, map
and filter
.
In [1]: range(4)
Out[1]: range(0, 4)
In [2]: map(lambda x: x**2, range(5))
We have already seen some Python expressions that exhibit lazy evaluation,
including range
, map
and filter
.
In [1]: range(4)
Out[1]: range(0, 4)
In [2]: map(lambda x: x**2, range(5))