We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 041a8af commit 9787a26Copy full SHA for 9787a26
docs/source/error_code_list.rst
@@ -1027,9 +1027,20 @@ example:
1027
1028
top = await f() # Error: "await" outside function [top-level-await]
1029
1030
+.. _code-await-not-async:
1031
+
1032
+Warn about await expressions used outside of coroutines [await-not-async]
1033
+-------------------------------------------------------------------------
1034
1035
+``await`` must be used inside a coroutine.
1036
1037
+.. code-block:: python
1038
1039
+ async def f() -> None:
1040
+ ...
1041
1042
def g() -> None:
- # This is a blocker error and cannot be silenced.
- await f() # Error: "await" outside coroutine ("async def")
1043
+ await f() # Error: "await" outside coroutine ("async def") [await-not-async]
1044
1045
.. _code-assert-type:
1046
0 commit comments