AI engineering glossary · Python advanced
What is coroutine?
Coroutine: A function defined with async def whose execution can be paused and resumed. Calling it returns a coroutine object that does nothing until awaited or scheduled on an event loop.
Coroutine: an example
c = fetch(url) only creates a coroutine object; await c or asyncio.run(c) actually runs it.
Related terms
More Python advanced terms
Where you learn it
Coroutine is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.