Skip to content

Commit

Permalink
Document await-not-async error code (#15858)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Aug 12, 2023
1 parent 041a8af commit 9787a26
Showing 1 changed file with 13 additions and 2 deletions.
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

0 comments on commit 9787a26

Please sign in to comment.