[Python-ideas] Propagating StopIteration value

Serhiy Storchaka storchaka at gmail.com
Sun Oct 7 20:40:41 CEST 2012


On 06.10.12 23:47, Mike Graham wrote:
> Can you provide an example of a time when you want to use such a value
> with a generator on which you want to use one of these so I can better
> understand why this is necessary? the times I'm familiar with wanting
> this value I'd usually be manually stepping through my generator.

There are no many uses yet because it's a new feature. Python 3.3 just 
released. For example see the proposed patch for 
http://bugs.python.org/issue16009. In general case `yield from` returns 
such a value.





More information about the Python-ideas mailing list