add glob1 glob0 to glob (#1368)

* add glob1 glob0 to glob

* add glob1 glob0 to python 3 stub

* fix types to take str and unicode

* Update glob.pyi
This commit is contained in:
amstree
2017-06-02 14:22:07 -04:00
committed by Łukasz Langa
parent 6d88431403
commit 66765c1fdb
2 changed files with 14 additions and 3 deletions

View File

@@ -1,4 +1,8 @@
from typing import List, Iterator, AnyStr
from typing import List, Iterator, Union
def glob(pathname: AnyStr) -> List[AnyStr]: ...
def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ...
_string = Union[str, unicode]
def glob(pathname: _string) -> List[_string]: ...
def iglob(pathname: _string) -> Iterator[_string]: ...
def glob1(dirname: _string, pattern: _string) -> List[_string]: ...
def glob0(dirname: _string, basename: _string) -> List[_string]: ...

View File

@@ -4,6 +4,13 @@
from typing import List, Iterator, AnyStr
import sys
if sys.version_info >= (3, 6):
def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ...
else:
def glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]: ...
def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ...
if sys.version_info >= (3, 5):
def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ...
def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ...