mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-16 19:11:26 +08:00
Accept PathLike[bytes] in os.listdir (#6870)
This commit is contained in:
1 parent
67c5d73cdb
commit
e6f28c052e
1 file changed
+3
-4
@@ -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]
|
||||
|
||||
|
||||
Reference in new issue
Block a user