[Python-ideas] lazy list

Chris Angelico rosuav at gmail.com
Thu May 14 17:01:43 CEST 2015


On Fri, May 15, 2015 at 12:52 AM, Alexander Atkins
<alexander at tutorfair.com> wrote:
> 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 itertools 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?
>

It may well already exist on PyPI. There are a few things with "lazy"
in their names; you'd have to poke around and see if one of them is of
use to you.

Another thing you might want to search for is "indexable map()", which
is a related concept (imagine calling map() with a function and a
list; the result is theoretically subscriptable, but not with Py3's
basic map() implementation) that I'm fairly sure I've seen around at
times.

https://pypi.python.org/pypi

Have fun searching. There's a huge lot out there, most of which isn't
what you want... but you never know what you'll find!

ChrisA


More information about the Python-ideas mailing list