massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / genericpath.pyi
1 import os
2 from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsLessThanT
3 from typing import Sequence, Tuple, overload
4 from typing_extensions import Literal
5
6 # All overloads can return empty string. Ideally, Literal[""] would be a valid
7 # Iterable[T], so that list[T] | Literal[""] could be used as a return
8 # type. But because this only works when T is str, we need Sequence[T] instead.
9 @overload
10 def commonprefix(m: Sequence[StrPath]) -> str: ...
11 @overload
12 def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
13 @overload
14 def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
15 @overload
16 def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ...
17 def exists(path: StrOrBytesPath | int) -> bool: ...
18 def getsize(filename: StrOrBytesPath | int) -> int: ...
19 def isfile(path: StrOrBytesPath | int) -> bool: ...
20 def isdir(s: StrOrBytesPath | int) -> bool: ...
21
22 # These return float if os.stat_float_times() == True,
23 # but int is a subclass of float.
24 def getatime(filename: StrOrBytesPath | int) -> float: ...
25 def getmtime(filename: StrOrBytesPath | int) -> float: ...
26 def getctime(filename: StrOrBytesPath | int) -> float: ...
27 def samefile(f1: StrOrBytesPath | int, f2: StrOrBytesPath | int) -> bool: ...
28 def sameopenfile(fp1: int, fp2: int) -> bool: ...
29 def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...