mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Accept PathLike[bytes] in os.listdir (#6870)
This commit is contained in:
@@ -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