Accept PathLike[bytes] in os.listdir (#6870)

This commit is contained in:
Joseph Young authored and GitHub committed 2022-01-09 16:17:01 +02:00
1 parent 67c5d73cdb
commit e6f28c052e
1 file changed
+3 -4
+3 -4
View File
@@ -1,5 +1,6 @@
import sys
from _typeshed import (
BytesPath,
FileDescriptorLike,
OpenBinaryMode,
OpenBinaryModeReading,
@@ -360,13 +361,11 @@ class PathLike(Protocol[_AnyStr_co]):
def __fspath__(self) -> _AnyStr_co: ...
@overload
def listdir(path: str | None = ...) -> list[str]: ...
def listdir(path: StrPath | None = ...) -> list[str]: ...
@overload
def listdir(path: bytes) -> list[bytes]: ...
def listdir(path: BytesPath) -> list[bytes]: ...
@overload
def listdir(path: int) -> list[str]: ...
@overload
def listdir(path: PathLike[str]) -> list[str]: ...
_FdOrAnyPath = Union[int, StrOrBytesPath]