[Python-3000] Is this a bug with list comprehensions or not?

Guido van Rossum guido at python.org
Tue Jul 15 19:17:55 CEST 2008


On Fri, Jul 11, 2008 at 5:11 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> From some experiments I just did using bare genexps and calling
> next() on them, I don't think anything is being silently caught
> in the genexp. What's happening is that the surrounding list()
> constructor is performing another level of iteration over the
> results of the genexp, and *that* is what's being stopped by
> the StopIteration.
>
> I don't see how this can be fixed, because there's no way for
> the list() constructor to know where the StopIteration is coming
> from.

Sounds like a good analysis to me. No bug here. Move along, nothing to see here!

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list