Generator expressions vs. comprehensions

Michele Simionato michele.simionato at gmail.com
Tue May 25 03:26:18 EDT 2010


On May 25, 9:08 am, Peter Otten <__pete... at web.de> wrote:
> But the list comprehension is already non-equivalent to the for loop as the
> loop variable isn't leaked anymore. We do have three similar constructs with
> subtle differences.
>
> I think not turning the list-comp into syntactic sugar for list(genexp) in
> py3 is a missed opportunity.

Actually I do agree with the feeling, and this is not the only missed
opportunity in Python 3 :-/



More information about the Python-list mailing list