Skip to content

awaitable

In Python, an awaitable is an object that you can use in an await expression. This means you can pause the execution of a coroutine and wait for the awaitable to complete before resuming the coroutine.

There are three main types of awaitable objects: coroutine objects, Tasks, and Futures. A coroutine function is defined with async def, and calling it returns a coroutine object, which is what you actually await. Tasks and Futures (from asyncio) are also awaitable and are commonly used with functions like asyncio.gather() and asyncio.wait(). Additionally, any object that implements the .__await__() method is awaitable.

Awaitables are a core part of asynchronous code in Python. They enable you to write non-blocking code by allowing other tasks to run while waiting for an I/O operation or any other time-consuming task to complete. This results in more efficient and responsive programs, especially when dealing with I/O-bound tasks, such as network requests or file handling.

Example

Here’s a quick example of using an awaitable in an asynchronous function:

Language: Python
>>> import asyncio

>>> async def say_hello():
...     print("Hello")
...     await asyncio.sleep(1)
...     print("World")
...

>>> # Usage
>>> asyncio.run(say_hello())
Hello
World

In this example, asyncio.sleep(1) returns an awaitable that pauses the say_hello() coroutine for one second. During this pause, the async event loop can run other tasks, making your program more efficient.

Async Programming in Python: From Generators to asyncio

Tutorial

Async Programming in Python: From Generators to asyncio

Learn how Python async programming works. Write async functions with async and await, and run slow I/O operations concurrently with asyncio.

intermediate python

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated July 10, 2026 • Reviewed by Dan Bader