Style question on recursive generators

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Oct 19 22:04:31 EDT 2004


Alex Martelli wrote:
> Dima Dorfman <d+pylist at nospamplease.trit.org> wrote:
> 
>>  yield *other
>>
>>to mean:
>>
>>  for x in other:
>>    yield x
> 
> Looks to me roughly equivalent to such proposals as 'yield from other';
> not totally out of whack but IMHO not warranted.

If it's a matter of whether a special syntax for this
is justified, it might open the way for some kind of
optimisation to bypass the overhead of the extra
for-loop.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list