yield_all needed in Python

Francis Girard francis.girard at free.fr
Tue Mar 1 14:17:35 EST 2005


Hi,

You absolutely and definitively have my vote. 

When I first learned the generators , I was even wondering if there was 
something wrong in what I do when faced with the sub-generators problem you 
describe. I was wondering "why am I doing this extra for-loop ? Is there 
something wrong ? Can I return the sub-iterator itself and let the final 
upper loop do the job ? But no, I absolutely have to 'yield'. What then ?" 

Therefore, the suggestion you make, or something similar, would have actually 
ease my learning, at least for me.

Regards,

Francis Girard

Le mardi 1 Mars 2005 19:22, Douglas Alan a écrit :
> For me, it's a matter of providing the ability to implement
> subroutines elegantly within generators.  Without yield_all, it is not
> elegent at all to use subroutines to do some of the yielding, since
> the calls to the subroutines are complex, verbose statements, rather
> than simple ones.




More information about the Python-list mailing list