-
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
Warn on Callable[<parameter_list>, None]
and Callable[<parameter_list>, Any]
as parameter annotations
#412
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jelle Zijlstra <[email protected]>
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This change has no effect on typeshed. 🤖🎉 |
I'd personally split these two cases. |
IIRC from when I did the analysis a few months ago, there were still enough false positives even with just But it was a while back when I looked at it; I might be misremembering. And there were lots of instances of |
I recently ran into a bug in internal code which would have been caught by a type checker if the callback had been annotated as In typeshed we probably should still aim for reducing false positives instead of false negatives, and that means using |
Fixes #237. The error code is disabled by default, due to the risk of false positive errors. However, it's possible that this check is too noisy even for a disabled-by-default error code.
Here's the output I get if I run
flake8 stubs stdlib --extend-select=Y091
with this PR branch on my local clone of typeshed: