Last active
November 23, 2021 20:09
-
-
Save nmchenry01/82ebf56831c787bd8b83c02b41c4b894 to your computer and use it in GitHub Desktop.
An example of creating and printing a coroutine
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
| from pprint import pprint | |
| async def something_async(): | |
| return "I'm not really async!" | |
| def main(): | |
| coroutine = something_async() | |
| print(f"{coroutine}\n") | |
| pprint(dir(coroutine)) | |
| main() | |
| # Output: | |
| # | |
| # <coroutine object something_async at 0x7fce604a14c0> | |
| # ['__await__', | |
| # '__class__', | |
| # '__del__', | |
| # '__delattr__', | |
| # '__dir__', | |
| # '__doc__', | |
| # '__eq__', | |
| # ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment