<div dir="ltr"><div class="gmail_extra">Well, generators are iterable, but if you write a function like:</div><div class="gmail_extra"><br></div><div class="gmail_extra">def f(s):</div><div class="gmail_extra">     for x in s:</div>

<div class="gmail_extra">             do_something(x)</div><div class="gmail_extra">     for x in s:</div><div class="gmail_extra">             do_something_else(x)</div><div class="gmail_extra"><br></div><div class="gmail_extra">

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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">

<br><div class="gmail_quote">On Thu, Sep 19, 2013 at 4:32 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im">My question would be, does the new class add anything that isn't<br></div></blockquote></div><br><br></div></div>