(*items)
return validate
Return an :mod:`attr` validator which raises a :class:`TypeError`
    if the value is not equivalent to one of the provided items.

    :param items: Items to compare against
    :return: a callable that returns with None or raises :class:`TypeError`
Return an :mod:`attr` validator which raises a :class:`TypeError`
    if the value is not equivalent to one of the provided items.
Return an : mod : attr validator which raises a : class : TypeError if the value is not equivalent to one of the provided items .
def one_of_validator(*items):
    """
    Return an :mod:`attr` validator which raises a :class:`TypeError`
    if the value is not equivalent to one of the provided items.

    :param items: Items to compare against
    :return: a callable that returns with None or raises :class:`TypeError`
    """
    def validate(inst, attribute, value):
        if value not in items:
            raise TypeError("{0} must be one of {1}".format(
                attribute.name, items))
    return validate
def one_of_validator ( * items ) : def validate ( inst , attribute , value ) : if value not in items : raise TypeError ( "{0} must be one of {1}" . format ( attribute . name , items ) ) return validate