Why do generator expressions return generators?

Brandon Benvie bbenvie at mozilla.com
Fri Sep 6 08:21:18 PDT 2013


On 9/6/2013 7:44 AM, Domenic Denicola wrote:
> What does having these be generators buy us? I am almost sure I'm missing something.

I don't think you're missing anything. They seem to be more accurately 
described as Iterator Expressions than Generator Expressions. It might 
be interesting if you could use yield inside them, which would then make 
sending a value in useful. But without that they don't expose any 
generator interface externally.


More information about the es-discuss mailing list