AI engineering glossary · Python advanced

What is async and await?

async and await: Keywords for asynchronous code. async def defines a coroutine function; await pauses it until another awaitable finishes, letting the event loop run other tasks meanwhile. Both keywords work only inside async def functions, apart from special cases.

Level: intermediateTopic: Python advanced

async and await: an example

async def get(): r = await client.get(url) pauses at the request while other coroutines proceed.

Related terms

More Python advanced terms

Where you learn it

async and await is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.