This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Günter Rote
Recipients Günter Rote, docs@python, r.david.murray
Date 2017-08-09.14:22:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502288522.63.0.578433190572.issue31156@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, that was my misinterpretation of what happened.
I had been stumbling over an old program I had written, but
apparently it works because the while-loop is inside
a generator function, and the StopIteration is simply
passed on.

Here is a small demonstration example:
>>> def f():
...   for x in range(5):
...     yield x
... 
>>> def g():
...   h=f()
...   while True:
...      yield next(h)+100
...      yield next(h)
... 
>>> list(g())
[100, 1, 102, 3, 104]

(I am beginning to wonder whether this program will be adversely affected by PEP 479 -- Change StopIteration handling inside generators.)
History
Date User Action Args
2017-08-09 14:22:02Günter Rotesetrecipients: + Günter Rote, r.david.murray, docs@python
2017-08-09 14:22:02Günter Rotesetmessageid: <1502288522.63.0.578433190572.issue31156@psf.upfronthosting.co.za>
2017-08-09 14:22:02Günter Rotelinkissue31156 messages
2017-08-09 14:22:02Günter Rotecreate