Coroutines: The Building Blocks
A coroutine is a special function that can pause and resume its execution. It's defined with async def:
Learning Objectives
Lesson Outline
A coroutine is a special function that can pause and resume its execution. It's defined with async def:
Calling a coroutine function doesn't execute it - it returns a coroutine object:
greet() returns a coroutine object. You must use await or asyncio.run() to actually execute it.