Re: Lazy lists for use with large dictionaries

Guido.van.Rossum@cwi.nl
Thu, 29 Sep 1994 16:58:45 +0100

> >Does this make sense?
> Yes, it does. Specifically as you obviously have implemented the keys()
> methods in an efficient way. That was the information I was looking for.

You could have looked in the source for keys() before complaining.

I am trying not to sound like flaming, but this does bother me
sometimes. There are too many questions "why does python do
this-and-this when it's obviously inefficient and real languages have
it" by people who haven't looked at the implementation nor tried
whether it really is inefficient. You just have to forget everything
you know about other languages, whether C or Lisp...

> Furthermore adding something like lazy lists would likely result in
> increased implementation complexity and it is questionable wether
> it is worth the effort.

I'm actually not convinced that it would complicate the
implementation. The complexity is now in the for loop which is one of
the more complicated parts of the compiler and interpreter -- and for
other situations (e.g. reading from files) it really WOULD be nice to
have lazy lists...

> >(This is actually the second time someone asks this -- maybe I should
> >add it to the FAQ.)
> I guess that is a good idea.

So I did.

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>