too-many-ancestors when inheriting from collections.abc.MutableSequence #4415
Labels
Enhancement ✨
Improvement to a component
False Positive 🦟
A message is emitted but nothing is wrong with the code
Milestone
Simply inheriting from collections.abc.MutableSequence generates a too-many-ancestors refactoring warning.
Yes, it does have that many ancestors, but I would consider only classes from the stdlib that are actually inherited by user code to be counted towards max ancestors.
And yes, I can disable this error in this case, or increase the max ancestors count, but it feels wrong to do that when just using the collections hierarchy for its intended purpose.
Steps to reproduce
For a minimal MutableSequence implemented, ancestor.py:
pylint ancestor.py returns:
ancestor.py:4:0: R0901: Too many ancestors (8/7) (too-many-ancestors)
Expected behavior
Inheriting from a stdlib class shouldn't generate a Refactor warning.
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: