Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,20 @@ example:

top = await f() # Error: "await" outside function [top-level-await]

.. _code-await-not-async:

Warn about await expressions used outside of coroutines [await-not-async]
-------------------------------------------------------------------------

``await`` must be used inside a coroutine.

.. code-block:: python

async def f() -> None:
...

def g() -> None:
# This is a blocker error and cannot be silenced.
await f() # Error: "await" outside coroutine ("async def")
await f() # Error: "await" outside coroutine ("async def") [await-not-async]

.. _code-assert-type:

Expand Down