From 8454a48c5ea0fa25d60891a33c3a1c820f2e35af Mon Sep 17 00:00:00 2001 From: Akuli Date: Mon, 25 Oct 2021 10:00:27 +0000 Subject: [PATCH] allow file descriptors in os.stat wrapper functions (#6198) --- stdlib/genericpath.pyi | 16 ++++++++-------- stdlib/posixpath.pyi | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/stdlib/genericpath.pyi b/stdlib/genericpath.pyi index 1c7be922e..56683e323 100644 --- a/stdlib/genericpath.pyi +++ b/stdlib/genericpath.pyi @@ -14,16 +14,16 @@ def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ... def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ... @overload def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ... -def exists(path: StrOrBytesPath) -> bool: ... -def getsize(filename: StrOrBytesPath) -> int: ... -def isfile(path: StrOrBytesPath) -> bool: ... -def isdir(s: StrOrBytesPath) -> bool: ... +def exists(path: StrOrBytesPath | int) -> bool: ... +def getsize(filename: StrOrBytesPath | int) -> int: ... +def isfile(path: StrOrBytesPath | int) -> bool: ... +def isdir(s: StrOrBytesPath | int) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. -def getatime(filename: StrOrBytesPath) -> float: ... -def getmtime(filename: StrOrBytesPath) -> float: ... -def getctime(filename: StrOrBytesPath) -> float: ... -def samefile(f1: StrOrBytesPath, f2: StrOrBytesPath) -> bool: ... +def getatime(filename: StrOrBytesPath | int) -> float: ... +def getmtime(filename: StrOrBytesPath | int) -> float: ... +def getctime(filename: StrOrBytesPath | int) -> float: ... +def samefile(f1: StrOrBytesPath | int, f2: StrOrBytesPath | int) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... diff --git a/stdlib/posixpath.pyi b/stdlib/posixpath.pyi index 92f6fd080..ae3d0d5cc 100644 --- a/stdlib/posixpath.pyi +++ b/stdlib/posixpath.pyi @@ -94,6 +94,6 @@ def splitext(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... @overload def splitext(p: AnyStr) -> tuple[AnyStr, AnyStr]: ... def isabs(s: StrOrBytesPath) -> bool: ... -def islink(path: StrOrBytesPath) -> bool: ... -def ismount(path: StrOrBytesPath) -> bool: ... -def lexists(path: StrOrBytesPath) -> bool: ... +def islink(path: StrOrBytesPath | int) -> bool: ... +def ismount(path: StrOrBytesPath | int) -> bool: ... +def lexists(path: StrOrBytesPath | int) -> bool: ...