-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
This code:
async def f() -> None:
pass
async def g() -> None:
f()
is incorrect because f()
isn't awaited. This will produce a runtime warning with the right debug settings, but mypy doesn't give any errors.
It would be nice if mypy could catch this, since I think it's a pretty common error in async code. This could be generalized to warning on other types or function return values that shouldn't be ignored (maybe open
?), similar to __attribute__((warn_unused_result))
in GCC.
Daenyth, WJCFerguson, math2001, suutari, nzig and 22 more