Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,10 @@ def check_method_or_accessor_override_for_base(self, defn: FuncBase,
"""Check if method definition is compatible with a base class."""
if base:
name = defn.name()
if name not in ('__init__', '__new__'):
# Check method override (__init__ and __new__ are special).
if name not in ('__init__', '__new__',
'__eq__', '__ne__', '__lt__', '__le__', '__gt__', '__ge__'):
# Check method override (__init__, __new__ and the comparison
# operators are special).
self.check_method_override_for_base_with_name(defn, name, base)
if name in nodes.inplace_operator_methods:
# Figure out the name of the corresponding operator method.
Expand Down