This repository was archived by the owner on Nov 23, 2017. It is now read-only.
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Closed
Description
In Python < 3.5, you could do a yield
or yield None
in a coroutine to give control to the event loop.
In Python 3.5, it is invalid to yield
in an async def
coroutine. So, what's the proper way of relinquishing control to the event loop?
One pattern is:
class AsyncNone(object):
__await__(self):
yield
async def cor():
for _ in range(100):
await AsyncNone()
But this seems very hacky.
Metadata
Metadata
Assignees
Labels
No labels