-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathutil.pyi
More file actions
40 lines (33 loc) · 1.62 KB
/
util.pyi
File metadata and controls
40 lines (33 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from collections.abc import MutableSequence, Sequence
from typing import Any, Final, Literal, Protocol, TypeVar, type_check_only
from typing_extensions import TypeAlias
@type_check_only
class _SupportsDunderLT(Protocol):
def __lt__(self, other: Any, /) -> bool: ...
@type_check_only
class _SupportsDunderGT(Protocol):
def __gt__(self, other: Any, /) -> bool: ...
@type_check_only
class _SupportsDunderLE(Protocol):
def __le__(self, other: Any, /) -> bool: ...
@type_check_only
class _SupportsDunderGE(Protocol):
def __ge__(self, other: Any, /) -> bool: ...
_T = TypeVar("_T")
_Mismatch: TypeAlias = tuple[_T, _T, int]
_SupportsComparison: TypeAlias = _SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT
_MAX_LENGTH: Final = 80
_PLACEHOLDER_LEN: Final = 12
_MIN_BEGIN_LEN: Final = 5
_MIN_END_LEN: Final = 5
_MIN_COMMON_LEN: Final = 5
_MIN_DIFF_LEN: Final = 41
def _shorten(s: str, prefixlen: int, suffixlen: int) -> str: ...
def _common_shorten_repr(*args: str) -> tuple[str, ...]: ...
def safe_repr(obj: object, short: bool = False) -> str: ...
def strclass(cls: type) -> str: ...
def sorted_list_difference(expected: Sequence[_T], actual: Sequence[_T]) -> tuple[list[_T], list[_T]]: ...
def unorderable_list_difference(expected: MutableSequence[_T], actual: MutableSequence[_T]) -> tuple[list[_T], list[_T]]: ...
def three_way_cmp(x: _SupportsComparison, y: _SupportsComparison) -> Literal[-1, 0, 1]: ...
def _count_diff_all_purpose(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ...
def _count_diff_hashable(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ...