mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-15 16:27:08 +08:00
Fix type annotations in fnmatch for Python 2.
Make some AnyStr others _EitherStr.
This commit is contained in:
committed by
Łukasz Langa
parent
10c5e0cb44
commit
f7aedb4d21
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user