Message84275
Ok, I see. Thanks.
However, I don't think yield should be consumed at the iterator's level.
It may be more useful for the outside function to consume the yield.
For example, some function want to change some data with another "thread".
def f():
...fetch data...
x = [yield i for i in data]
It should be written as belowed in Python 3.1 now
def f():
x = []
for i in data:
x.append((yield i)) |
|
Date |
User |
Action |
Args |
2009-03-27 16:52:22 | qwjqwj | set | recipients:
+ qwjqwj, pitrou |
2009-03-27 16:52:22 | qwjqwj | set | messageid: <1238172742.56.0.406156464826.issue5577@psf.upfronthosting.co.za> |
2009-03-27 16:52:21 | qwjqwj | link | issue5577 messages |
2009-03-27 16:52:20 | qwjqwj | create | |
|