<div dir="ltr"><div>Hi, I'm new to this mailing list.</div><div><br></div><div>I needed a lazy list implementation for something, so I created one.  I was a little bit surprised to find that there wasn't one in the <b>itertools</b> module and it seemed like quite a basic thing to me, as someone who has used Haskell before, so I thought probably I should share it.  I'm wondering whether something like this should be part of the standard library?</div><div><br></div><div>A fuller explanation is in the README, which is here: <a href="https://github.com/jadatkins/python-lazylist">https://github.com/jadatkins/python-lazylist</a></div><div>The gist of it is that it allows you to index into a generator.  Previously evaluated elements are remembered, so foo[5] returns the same thing each time, and you can later call foo[4] and get the previous element.  There are many uses for such a thing, but if you're not expecting it in the language, you might not necessarily think of them.</div><div><br></div><div>Warning: it may contain bugs, especially the stuff to do with slicing, which is not really what it's for.</div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><span style="font-family:'Times New Roman';font-size:12.8px;color:rgb(102,102,102);display:table-cell;vertical-align:middle"><div dir="ltr" style="color:rgb(0,0,0);font-size:medium"><span style="font-size:12.8px;color:rgb(102,102,102)"><font face="arial, helvetica, sans-serif">--</font></span></div><div dir="ltr" style="color:rgb(0,0,0);font-size:medium"><span style="font-size:12.8px;color:rgb(102,102,102)"><b><font face="arial, helvetica, sans-serif">J Alexander D Atkins<br></font></b></span></div><div dir="ltr" style="color:rgb(0,0,0);font-size:medium"></div></span><span style="font-family:'Times New Roman';font-size:12.8px;color:rgb(102,102,102);display:table-cell;vertical-align:middle"><font face="arial, helvetica, sans-serif"><br></font></span><div><div dir="ltr"></div></div></div></div></div></div>
</div>