MemotivaAsynchronous programming and asyncio

What is the difference between a coroutine and a Task?

Asynchronous programming and asyncio

Audio flashcard · 0:15

Nortren·

What is the difference between a coroutine and a Task?

0:15

A coroutine is an awaitable object representing a paused computation. A Task wraps a coroutine and schedules it on the event loop, where it runs concurrently with other tasks. You create a Task with asyncio.create_task or asyncio.TaskGroup.
docs.python.org