-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add truthy-coroutine check #16069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
erictraut
pushed a commit
to microsoft/pyright
that referenced
this issue
Sep 9, 2023
…e, which always evaluates to True. This is likely indicative of a missing `await` keyword. This addresses a feature request logged in the mypy issue tracker: python/mypy#16069.
This is supported with
|
@sterliakov You misread the report. I'm aware that truthy-bool would report it. |
Indeed, my apologies! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature
In this code, a likely fix is to change
func()
toawait func()
. Meanwhile, it'll always be true since aCoroutine
is always true. Thetruthy-bool
check could flag it but it's not enabled by default. We can add a newtruthy-coroutine
check (liketruthy-function
) for the specific case of using aCoroutine
in boolean context.The error message can suggest that an
await
might've been mistakenly omitted.The text was updated successfully, but these errors were encountered: