def __eq__(self, other):
        """
        Return True if other represents an object with the same key.
        """
        if type(self) == type(other):
            return self.type() == other.type() and self.data() == other.data()
        else:
            return NotImplemented

        Return True if other represents an object with the same key.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/keys.py