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
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/E452U6MTPRL4G7SYP6BJBPFUYHZPCNJ5/
Code of Conduct: http://python.org/psf/codeofconduct/