accept PathLike in os.scandir (#1546)

This commit is contained in:
Jelle Zijlstra
2017-08-21 13:54:22 -07:00
committed by Łukasz Langa
parent 5c328f12e1
commit c40b7afc14

View File

@@ -342,11 +342,16 @@ def renames(old: _PathType, new: _PathType) -> None: ...
if sys.version_info >= (3, 3):
def replace(src: _PathType, dst: _PathType) -> None: ...
def rmdir(path: _PathType) -> None: ...
if sys.version_info >= (3, 5):
if sys.version_info >= (3, 6):
@overload
def scandir(path: str = ...) -> Iterator[DirEntry[str]]: ...
def scandir() -> Iterator[DirEntry[str]]: ...
@overload
def scandir(path: bytes) -> Iterator[DirEntry[bytes]]: ...
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> Iterator[DirEntry[AnyStr]]: ...
elif sys.version_info >= (3, 5):
@overload
def scandir() -> Iterator[DirEntry[str]]: ...
@overload
def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ...
def stat(path: _PathType) -> stat_result: ...
def stat_float_times(newvalue: Union[bool, None] = ...) -> bool: ...
def statvfs(path: _PathType) -> statvfs_result: ... # Unix only