On Sun, Apr 4, 2010 at 7:20 PM, Masklinn <firstname.lastname@example.org>
On 4 Apr 2010, at 18:58 , cool-RR wrote:
> I'm still a bit confused by generators and generator expressions, but what
> about making a `generator.__add__` method, that'll act like
What would the use case be,
I'm not sure I understand your question. The same use case as for `itertools,chain`: When you have several generators you want to iterate over, one after another. (True, it might be not as good when you have more than 2.)
and why couldn't you use itertools.chain or
generator.send for that?
I could use `itertools.chain`, but why type so much? I think if you have two generators, g1 and g2, then it makes sense that g1 + g2 will be an iterator that goes over the elements of both of them.
About `generator.send`, I don't understand how it's related. But I'm still new to this.