id = property(lambda self: self._id)
name = property(lambda self: self._name)

def __eq__(self, other):
    return self.id == other.id and self.name == other.name

def __hash__(self):
    return hash(('id', self.id, 'name', self.name))
Explanation needed regarding explanation of hashable objects