mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Use the FileDescriptorOrPath alias consistently in the stdlib (#9513)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
|
||||
from _typeshed import BytesPath, FileDescriptorOrPath, StrPath, SupportsRichComparisonT
|
||||
from collections.abc import Sequence
|
||||
from typing import overload
|
||||
from typing_extensions import Literal, LiteralString
|
||||
@@ -31,16 +31,16 @@ def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
|
||||
def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ...
|
||||
def exists(path: StrOrBytesPath | int) -> bool: ...
|
||||
def getsize(filename: StrOrBytesPath | int) -> int: ...
|
||||
def isfile(path: StrOrBytesPath | int) -> bool: ...
|
||||
def isdir(s: StrOrBytesPath | int) -> bool: ...
|
||||
def exists(path: FileDescriptorOrPath) -> bool: ...
|
||||
def getsize(filename: FileDescriptorOrPath) -> int: ...
|
||||
def isfile(path: FileDescriptorOrPath) -> bool: ...
|
||||
def isdir(s: FileDescriptorOrPath) -> bool: ...
|
||||
|
||||
# These return float if os.stat_float_times() == True,
|
||||
# but int is a subclass of float.
|
||||
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 getatime(filename: FileDescriptorOrPath) -> float: ...
|
||||
def getmtime(filename: FileDescriptorOrPath) -> float: ...
|
||||
def getctime(filename: FileDescriptorOrPath) -> float: ...
|
||||
def samefile(f1: FileDescriptorOrPath, f2: FileDescriptorOrPath) -> bool: ...
|
||||
def sameopenfile(fp1: int, fp2: int) -> bool: ...
|
||||
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user