validator: Generalize type of check_string_in argument.

This commit is contained in:
Alex Vandiver
2023-05-11 17:59:46 +00:00
committed by Tim Abbott
parent 01241f0e72
commit 79c1123700

View File

@@ -36,6 +36,7 @@ from typing import (
Any,
Callable,
Collection,
Container,
Dict,
Iterator,
List,
@@ -83,7 +84,7 @@ def check_required_string(var_name: str, val: object) -> str:
return s
def check_string_in(possible_values: Union[Set[str], List[str]]) -> Validator[str]:
def check_string_in(possible_values: Container[str]) -> Validator[str]:
def validator(var_name: str, val: object) -> str:
s = check_string(var_name, val)
if s not in possible_values: