Skip to content

Instantly share code, notes, and snippets.

@nmchenry01
Last active November 23, 2021 20:09
Show Gist options
  • Select an option

  • Save nmchenry01/82ebf56831c787bd8b83c02b41c4b894 to your computer and use it in GitHub Desktop.

Select an option

Save nmchenry01/82ebf56831c787bd8b83c02b41c4b894 to your computer and use it in GitHub Desktop.
An example of creating and printing a coroutine
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