Christian Tanzer wrote:
> How about:
> 
>   def main_generator():
>       ...
>       yield * sub_generator()
> 
> Ducking-ly yrs,
> 

I like that one, but I'd stick the star to the generator (e.g. yield 
*sub_generator), the meaning being to "unpack" the generator into the 
yield, same as unpacking a sequence passed as function parameters.

As an extension, the syntax may even (though I'm not sure it'd be a good 
idea to do so) work with any iterable, behaving the same way (yielding 
the successive values of the iterable object)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to