diff --git a/stdlib/2/fnmatch.pyi b/stdlib/2/fnmatch.pyi index 23b5978f2..e933b7b2c 100644 --- a/stdlib/2/fnmatch.pyi +++ b/stdlib/2/fnmatch.pyi @@ -1,6 +1,8 @@ -from typing import Iterable +from typing import AnyStr, Iterable, List, Union -def fnmatch(filename: str, pattern: str) -> bool: ... -def fnmatchcase(filename: str, pattern: str) -> bool: ... -def filter(names: Iterable[str], pattern: str) -> Iterable[str]: ... -def translate(pattern: str) -> str: ... +_EitherStr = Union[str, unicode] + +def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ... +def translate(pattern: AnyStr) -> AnyStr: ...