mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
os: fix getenvb, scandir (#3723)
* os: fix getenvb * os: scandir accepts None
This commit is contained in:
@@ -361,7 +361,10 @@ if sys.platform != 'win32':
|
||||
def getenv(key: Text) -> Optional[str]: ...
|
||||
@overload
|
||||
def getenv(key: Text, default: _T) -> Union[str, _T]: ...
|
||||
def getenvb(key: bytes, default: bytes = ...) -> bytes: ...
|
||||
@overload
|
||||
def getenvb(key: bytes) -> Optional[bytes]: ...
|
||||
@overload
|
||||
def getenvb(key: bytes, default: _T = ...) -> Union[bytes, _T]: ...
|
||||
def putenv(__name: Union[bytes, Text], __value: Union[bytes, Text]) -> None: ...
|
||||
def unsetenv(__name: Union[bytes, Text]) -> None: ...
|
||||
|
||||
@@ -480,7 +483,7 @@ if sys.version_info >= (3, 7):
|
||||
def __next__(self) -> DirEntry[AnyStr]: ...
|
||||
def close(self) -> None: ...
|
||||
@overload
|
||||
def scandir() -> _ScandirIterator[str]: ...
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: int) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
@@ -490,12 +493,12 @@ elif sys.version_info >= (3, 6):
|
||||
def __next__(self) -> DirEntry[AnyStr]: ...
|
||||
def close(self) -> None: ...
|
||||
@overload
|
||||
def scandir() -> _ScandirIterator[str]: ...
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ...
|
||||
else:
|
||||
@overload
|
||||
def scandir() -> Iterator[DirEntry[str]]: ...
|
||||
def scandir(path: None = ...) -> Iterator[DirEntry[str]]: ...
|
||||
@overload
|
||||
def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ...
|
||||
def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
|
||||
Reference in New Issue
Block a user