Sam Frances <s...@samfrances.uk> added the comment:
Apologies for the stray unused function in the example. It should have read: ``` import asyncio async def count(): try: i = 0 while True: yield i i += 1 finally: print("count() cleanup") async def double(source): try: async for n in source: yield n * 2 finally: print("double() cleanup") async def main(): async for i in double(count()): if i > 10: return print(i) asyncio.run(main()) ``` ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37455> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com