消息 [252429]
Consider the following generator function similar to the one that started this issue:
from __future__ import generator_stop
def myzip(*seqs):
its = (iter(seq) for seq in seqs)
while True:
try:
yield tuple(next(it) for it in its)
except RuntimeError:
return
g = myzip('abc', 'xyz')
print([next(g) for i in range(5)]) # prints: [('a', 'x'), (), (), (), ()]
A print(list(g)) would cause a hang. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2015-10-06 20:26:25 | john.black.3k | 修改 | recipients:
+ john.black.3k, gvanrossum, rhettinger, ncoghlan, belopolsky, scoder, vstinner, r.david.murray, ethan.furman, Yury.Selivanov, python-dev, schlamar, Rosuav, berker.peksag, serhiy.storchaka, yselivanov, NeilGirdhar |
| 2015-10-06 20:26:25 | john.black.3k | 修改 | messageid: <1444163185.33.0.549519157891.issue22906@psf.upfronthosting.co.za> |
| 2015-10-06 20:26:25 | john.black.3k | 链接 | issue22906 messages |
| 2015-10-06 20:26:24 | john.black.3k | 创建 | |
|