Message172204
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. |
|
Date |
User |
Action |
Args |
2012-10-06 14:52:29 | pyos | set | recipients:
+ pyos, rhettinger |
2012-10-06 14:52:28 | pyos | set | messageid: <1349535148.95.0.484121382755.issue16150@psf.upfronthosting.co.za> |
2012-10-06 14:52:28 | pyos | link | issue16150 messages |
2012-10-06 14:52:28 | pyos | create | |
|