Search notes:

Python: async def

async def functions return coroutine objects

A function declared with async def returns a coroutine object:
import asyncio

async def coro_func(): pass

coro_obj = coro_func()

print(type(coro_obj)) # <class 'coroutine'>

asyncio.run(coro_obj)

Key properties of coroutines

PEP 492 lists some properties of coroutines:

RuntimeWarning: coroutine 'coro' was never awaited

import asyncio

async def coro(): pass

coro()

Index