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

Bengt Richter bokr at oz.net
Tue Apr 26 22:07:44 EDT 2005


On Tue, 26 Apr 2005 13:22:28 -0400, "Terry Reedy" <tjreedy at udel.edu> wrote:

>
>"Mike Meyer" <mwm at mired.org> wrote in message
>> The question under these circumstances is then: do you want bare
>> genexp to mean something? Right now, it's a syntax error. But there's
>> no reason you couldn't have:
>>
>>   y = x for x in stuff
>>
>> assign a generator object to y.
>
>Since this was considered, there is a reason why we don't have this.  As I 
>remenber, but vaguely, Guido's reasoning was both stylistic and technical, 
>but you'd have to check the archives for more.
>
Because it is too reminiscent of a lambda expression assignment? ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list