<p dir="ltr"><br>
On 19 Sep 2013 18:59, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com">mistersheik@gmail.com</a>> wrote:<br>
><br>
> Well, generators are iterable, but if you write a function like:<br>
><br>
> def f(s):<br>
>      for x in s:<br>
>              do_something(x)<br>
>      for x in s:<br>
>              do_something_else(x)<br>
><br>
> 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.</p>
<p dir="ltr">Generators *are* iterators, though, so they fail the second half of the check. Hence my question - is there any obvious case where "iterable but not an iterator" gives the wrong answer?</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
><br>
> On Thu, Sep 19, 2013 at 4:32 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
>><br>
>> My question would be, does the new class add anything that isn't<br>
><br>
><br>
><br>
</p>