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 pyos
Recipients pyos, rhettinger
Date 2012-10-06.14:52:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349535148.95.0.484121382755.issue16150@psf.upfronthosting.co.za>
In-reply-to
Content
Since "yield from" made it into Python 3.3, I think it would be useful to chain multiple generators and still get a generator, not an iterator. That is, the following code:

def f():
    yield from itertools.chain(A, B, C)

should be (at least roughly) equivalent to

def f():
    yield from A
    yield from B
    yield from C

while still allowing to send() values to whichever subgenerator is currently running or throw() exceptions inside them.

The attached patch adds this functionality to itertools.chain objects.
History
Date User Action Args
2012-10-06 14:52:29pyossetrecipients: + pyos, rhettinger
2012-10-06 14:52:28pyossetmessageid: <1349535148.95.0.484121382755.issue16150@psf.upfronthosting.co.za>
2012-10-06 14:52:28pyoslinkissue16150 messages
2012-10-06 14:52:28pyoscreate