-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix too-many-ancestors #4416
Fix too-many-ancestors #4416
Conversation
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.
Good job !
@@ -1,2 +1,2 @@ | |||
too-many-ancestors:20:0:Iiii:Too many ancestors (9/7) | |||
too-many-ancestors:23:0:Jjjj:Too many ancestors (10/7) | |||
too-many-ancestors:21:0:Iiii:Too many ancestors (8/7) |
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.
This actually fixed that test case too, the correct number IS 8 !
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.
Depends if you con't object
, but it's certainly not false.
I also get this error when inheriting from any normal class (which doesn't cause this error) and a Protocol (which while not necessary is nice to ensure we override the required functions). Whilst we only inherit directly from two classes we get too-many-ancestors 8/7. This error can be reproduced by: # Sub Command is a Protocol but we want to explicitly inherit |
@SagaraBattousai please open a new issue your comment on a closed issue is going to get lost. |
Steps
doc/whatsnew/<current release.rst>
.Description
Fix false-positive
too-many-ancestors
by ignoring pre-defined builtin classes when calculating the number of ancestors. The list isn't complete but should cover most cases.Type of Changes
Related Issue
Closes #4166
Closes #4415