
May 1, 2021
8:15 a.m.
On Sat, May 01, 2021 at 06:21:43AM -0000, Valentin Berlier wrote:
The builtin interables bytearray, bytes, enumerate, filter frozenset, map, memoryview, range, reversed, tuple and zip suggest differently.
enumerate, filter, map, range, reversed and zip don't apply because they're not collections,
You didn't say anything about *collections*, you talked about builtin *iterables*. And range is a collection: >>> import collections.abc >>> isinstance(range(10), collections.abc.Collection) True
you wouldn't be able to store the result of the computation anywhere.
I don't know what this objection means. The point of iterators like map, zip and filter is to *avoid* performing the computation until it is required. -- Steve