Your reading of documents is correct - you need to give the method ( __eq__ ) the same signature as in the base class ( object ), or more permissive.
The reason for this is that since your MyObject is a subtype of object , a MyObject can be passed anywhere where an object is expected ... which means that this code could compare it to any other object , and there is no legal way to check type to complain. So, to reflect this, your __eq__ must be written to wait for any object .
What you can do is right in the body of the method, check the type and return (or throw an exception):
if not isinstance(other, MyObject): return False
Then, as these documents say , Mypy is smart enough that after this check, he will know that other is MyObject and treat it accordingly.
source share