-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Extend W0236 checker to detect return type mismatches in overridden methods #10449
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #10449 +/- ##
==========================================
- Coverage 95.90% 95.88% -0.02%
==========================================
Files 176 176
Lines 19130 19159 +29
==========================================
+ Hits 18347 18371 +24
- Misses 783 788 +5
π New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
π€ Effect of this PR on checked open source code: π€ Effect on astroid:
Effect on home-assistant:
This comment was truncated because GitHub allows only 65536 characters in a comment. This comment was generated for commit a76ccc5 |
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 think the primer is showing a lot of false positives. Wouldn't this be a check that is (nowadays) more relevant in a type checker?
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.
Agree with @DanielNoord this is the kind of check that is hard to do in pylint. If it's easy to fix the false positives do then let's do it but maybe it's better to let a type checker handle this.
Type of Changes
Description
Closes #10351
invalid-overridden-method
(W0236) checker to detect return type mismatches in overridden methods_are_return_types_compatible
helper to check compatibility using the following conditions:1.) excat match
2.) subclassing (covariance)
3.) Special handling for return type
Any
Had this branch open for while now, so I decided to finish the implementation. Let me know what you think :)