diff options
Diffstat (limited to 'pylint/checkers/utils.py')
-rw-r--r-- | pylint/checkers/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 7f04e22f7..6e96b3a97 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -456,8 +456,11 @@ def assign_parent(node: nodes.NodeNG) -> nodes.NodeNG: def overrides_a_method(class_node: nodes.ClassDef, name: str) -> bool: - """return True if <name> is a method overridden from an ancestor""" + """return True if <name> is a method overridden from an ancestor + which is not the base object class""" for ancestor in class_node.ancestors(): + if ancestor.name == "object": + continue if name in ancestor and isinstance(ancestor[name], nodes.FunctionDef): return True return False |