[Python-ideas] Introduce collections.Reiterable
Neil Girdhar
mistersheik at gmail.com
Thu Sep 19 10:59:35 CEST 2013
Well, generators are iterable, but if you write a function like:
def f(s):
for x in s:
do_something(x)
for x in s:
do_something_else(x)
x should not be a generator. I am proposing adding a function to itertools
like auto_reiterable that would take s and give you an reiterable in the
most efficient way possible.
On Thu, Sep 19, 2013 at 4:32 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> My question would be, does the new class add anything that isn't
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130919/25900a05/attachment.html>
More information about the Python-ideas
mailing list