mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
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:
@@ -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]: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user