mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
accept PathLike in os.scandir (#1546)
This commit is contained in:
committed by
Łukasz Langa
parent
5c328f12e1
commit
c40b7afc14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user