Fix type annotations in fnmatch for Python 2.

Make some AnyStr others _EitherStr.
This commit is contained in:
David Euresti
2017-02-17 16:32:49 -08:00
committed by Łukasz Langa
parent 10c5e0cb44
commit f7aedb4d21

View File

@@ -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: ...