-
Notifications
You must be signed in to change notification settings - Fork 23
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
Callables whose return value is ignored #237
Comments
I'm starting to wonder if we should split the tool in two: one flake8 plugin for checks which only apply for stubs, another which has typing-related checks for Or maybe we should just bite the bullet and add the necessary complexity to make the plugin |
We could also try to get some of the non-pyi-specific checks accepted into flake8/pyflakes(?). |
We could try, but I think they would probably be rejected. I think the checks we have here are probably too typing-specific. There are other plugins that specialise in providing checks for annotations, e.g. https://github.com/sco1/flake8-annotations. The checks https://github.com/sco1/flake8-annotations currently does are pretty basic, though, imo. |
There's a few ways to type this function:
Callable[[], None]
is not great, because it doesn't allow you to pass a callback that does return something; that will also work at runtime, and the return value is ignored. When I learned about this, I changed my callbacks to useCallable[[], Any]
instead. ButCallable[[], object]
would be even better.We could check for this, but does it belong to this tool? This lint isn't really stub-specific.
The text was updated successfully, but these errors were encountered: