def METHOD_NAME(self, value):
    if not any(isinstance(value, t) for t in self._types):
        typedescr = '|'.join(t.__name__ for t in self._types)
        raise TypeError(
            "failed to set field '%s': '%s' is not of type '%s'" %
            (self._name, value, typedescr))