Sam Frances <[email protected]> added the comment:
One final note: changing the `main()` function from the example to add a
zero-sleep seems to fix it, but this seems like a rather ad-hoc solution.
```
async def main():
async for i in double(count()):
if i > 10:
break
print(i)
await asyncio.sleep(0)
```
result:
```
$ python example.py
0
2
4
6
8
10
double() cleanup
count() cleanup
```
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com