Warn on Callable[<parameter_list>, None] and Callable[<parameter_list>, Any] as parameter annotations#412
Warn on Callable[<parameter_list>, None] and Callable[<parameter_list>, Any] as parameter annotations#412AlexWaygood wants to merge 5 commits intomainfrom
Callable[<parameter_list>, None] and Callable[<parameter_list>, Any] as parameter annotations#412Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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 |
|
@AlexWaygood Are you still interested in this? I think it would generally be a good idea to add it. |
Maybe, but I'm a little short on time right now :-( feel free to take it over if you're interested in picking it up! |
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=Y091with this PR branch on my local clone of typeshed:Details