Created
November 30, 2019 23:11
-
-
Save vskrachkov/d3bcad9eaa71d63b5b43d014fa98734f to your computer and use it in GitHub Desktop.
Create awaitable object in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
class Awaitable: | |
def __await__(self): | |
yield | |
async def main(): | |
await Awaitable() | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment