What's do list comprehensions do that generator expressions don't?

Mike Meyer mwm at mired.org
Tue Apr 26 00:00:57 EDT 2005


Jeremy Bowers <jerf at jerf.org> writes:

> On Mon, 25 Apr 2005 16:48:46 -0400, Bill Mill wrote:
> generalizing anyways, which is the right approach. I doubt that Python 3.0
> would have two radically different implementations; they'll just have the
> genexp implementation, and an optimization for list creation if the list
> creation can know the size in advance, regardless of where it came from.

Why do we have to wait for Python 3.0 for this? Couldn't list
comprehensions and generator expression be unified without breaking
existing code that didn't deserve to be broken?

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list