def METHOD_NAME(self, other, method):
    if not isinstance(other, self.__class__):
        other = self.__class__(other)
    newdata = method(other.data)
    newset = self.__class__()
    newset.data = newdata
    return newset