<div dir="ltr">No, not things which are iterable but not iterators, things which are *reiterable* rather than merely iterable.  That is, things that can be iterated multiple times without the generated elements disappearing.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 19, 2013 at 5:20 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><p dir="ltr"><br>
On 19 Sep 2013 19:14, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>> wrote:<br>
><br>
> I am proposing a new class "Reiterable" that is a subclass of Iterable.  For example, a dictionary view is a reiterable.  It would be fine to pass such an object to the function f.</p>
</div><p dir="ltr">I'm afraid simply repeating your proposal still doesn't answer my question. You have indicated that you are trying to identify things that are iterable, but not iterators. That is already possible using a second isinstance check to exclude iterators.</p>



<p dir="ltr">So, what is the value you see in adding a new ABC to further simplify an already simple check?</p>
<p dir="ltr">Cheers,<br>
Nick.</p><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> Best,<br>
> Neil<br>
><br>
><br>
> On Thu, Sep 19, 2013 at 5:12 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> On 19 Sep 2013 18:59, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com" target="_blank">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.<br>
>><br>
>> 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?<br>
>><br>
>> Cheers,<br>
>> Nick.<br>
>><br>
>> ><br>
>> ><br>
>> > On Thu, Sep 19, 2013 at 4:32 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>> wrote:<br>
>> >><br>
>> >> My question would be, does the new class add anything that isn't<br>
>> ><br>
>> ><br>
>> ><br>
><br>
><br>
</p>
</div></div></blockquote></div><br></div>