Stdlib: add many missing __hash__ and __eq__ methods (#10464)

This commit is contained in:
Alex Waygood
2023-07-17 13:21:02 +01:00
committed by GitHub
parent a04822051f
commit 03b4bb9cce
22 changed files with 78 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ class Statistic:
traceback: Traceback
def __init__(self, traceback: Traceback, size: int, count: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
class StatisticDiff:
count: int
@@ -46,6 +47,7 @@ class StatisticDiff:
traceback: Traceback
def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
_FrameTuple: TypeAlias = tuple[str, int]
@@ -56,6 +58,7 @@ class Frame:
def lineno(self) -> int: ...
def __init__(self, frame: _FrameTuple) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def __lt__(self, other: Frame) -> bool: ...
if sys.version_info >= (3, 11):
def __gt__(self, other: Frame) -> bool: ...
@@ -80,6 +83,7 @@ class Trace:
def traceback(self) -> Traceback: ...
def __init__(self, trace: _TraceTuple) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
class Traceback(Sequence[Frame]):
if sys.version_info >= (3, 9):
@@ -97,6 +101,7 @@ class Traceback(Sequence[Frame]):
def __contains__(self, frame: Frame) -> bool: ... # type: ignore[override]
def __len__(self) -> int: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def __lt__(self, other: Traceback) -> bool: ...
if sys.version_info >= (3, 11):
def __gt__(self, other: Traceback) -> bool: ...