The implementation is bad.  This should be `return type(self) == type(other)`.