asyncExpert Playground

Declares an asynchronous coroutine function or context manager

Python Playground
Output
Click "Run" to execute your code

async def sets the CO_COROUTINE flag on the code object. The bytecode uses GET_AWAITABLE and SEND to implement await. Coroutine objects track their state (created, running, suspended, closed).

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?