(choices: T.Set[str])
return inner
Check that the choice given was one of the given set.
Check that the choice given was one of the given set.
Check that the choice given was one of the given set .
def in_set_validator(choices: T.Set[str]) -> T.Callable[[str], T.Optional[str]]:
    """Check that the choice given was one of the given set."""

    def inner(check: str) -> T.Optional[str]:
        if check not in choices:
            return f"must be one of {', '.join(sorted(choices))}, not {check}"
        return None

    return inner
def in_set_validator ( choices : T . Set [ str ] ) -> T . Callable [ [ str ] , T . Optional [ str ] ] : def inner ( check : str ) -> T . Optional [ str ] : if check not in choices : return f"must be one of {', '.join(sorted(choices))}, not {check}" return None return inner