-
Notifications
You must be signed in to change notification settings - Fork 24
Reduce false-positives emitted from Y026 TypeAlias check
#206
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
Conversation
|
I've done some random skimming of the output from typeshed_primer here, and it looks like this gets rid of the vast majority of the false positives while retaining the vast majority of the true positives. |
|
There are still some false positives, even with this patch. I'm working on it. |
JelleZijlstra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a draft, but I want to clear my requested review list :)
I'm wary of a heuristic-heavy approach like this since if it goes wrong, it will be hard for new contributors to understand the problem.
What if we limit ourselves to extremely obvious cases like those where the RHS has a | at the top level?
I'm moving in that direction as well after discovering more false positives when working on python/typeshed#7630 :) |
|
With the latest version of this patch (and following python/typeshed#7630), there are now only 4 hits in typeshed: These are all places where we can't currently use |
Fixes #205.
I've temporarily renamed the check from Y026 to Y038 so that I can see the impact using typeshed_primer in CI. I'll revert the renaming once the CI has completed.
(EDIT: The output looked good, so I reverted the renaming.)