Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

validator: Generalize type of check_string_in argument.

Alex Vandiver79c1123700fd
diff --git a/zerver/lib/validator.py b/zerver/lib/validator.py
index 5c0aaaca6bd..977130f83b1 100644
--- a/zerver/lib/validator.py
+++ b/zerver/lib/validator.py
@@ -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: