def METHOD_NAME(self, other):
    if self.is_bytes != other.is_bytes:
        return False
    if self.is_bytes:
        return self.object == other.object
    else:
        return self.object.cache_key == other.object.cache_key