mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
Use conditional overloads to simplify several stdlib functions (#7540)
This commit is contained in:
@@ -732,20 +732,15 @@ class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_Scand
|
||||
def __exit__(self, *args: object) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
@overload
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: int) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: AnyStr | PathLike[AnyStr]) -> _ScandirIterator[AnyStr]: ...
|
||||
|
||||
else:
|
||||
@overload
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: AnyStr | PathLike[AnyStr]) -> _ScandirIterator[AnyStr]: ...
|
||||
|
||||
@overload
|
||||
def scandir(path: AnyStr | PathLike[AnyStr]) -> _ScandirIterator[AnyStr]: ...
|
||||
def stat(path: _FdOrAnyPath, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
|
||||
Reference in New Issue
Block a user