typing: Stop using Collection[str].

Apparently, Collection is unavailable in Python 3.5, so we can't use
it.  Reverting to a Union for now.
This commit is contained in:
Tim Abbott 2020-04-03 15:53:37 -07:00
parent b66a67272f
commit 5aa6aeb303
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import validate_email, URLValidator
from typing import Any, Dict, Iterable, Optional, Tuple, cast, List, Callable, TypeVar, \
Collection
Set, Union
from datetime import datetime
from zerver.lib.request import JsonableError
@ -71,7 +71,7 @@ def check_required_string(var_name: str, val: object) -> Optional[str]:
return None
def check_string_in(possible_values: Collection[str]) -> Validator:
def check_string_in(possible_values: Union[Set[str], List[str]]) -> Validator:
@set_type_structure("str")
def validator(var_name: str, val: object) -> Optional[str]:
not_str = check_string(var_name, val)