Add __hash__ for a bunch of types that set it to None (#13286)

This commit is contained in:
Stephen Morton
2024-12-23 23:16:22 -08:00
committed by GitHub
parent 1f0a86ceb4
commit 3944c7839e
32 changed files with 69 additions and 27 deletions

View File

@@ -2,7 +2,7 @@ import sys
from _typeshed import SupportsWrite, Unused
from collections.abc import Generator, Iterable, Iterator, Mapping
from types import FrameType, TracebackType
from typing import Any, Literal, overload
from typing import Any, ClassVar, Literal, overload
from typing_extensions import Self, TypeAlias, deprecated
__all__ = [
@@ -229,6 +229,7 @@ class TracebackException:
) -> Self: ...
def __eq__(self, other: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
if sys.version_info >= (3, 11):
def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ...
else:
@@ -292,6 +293,7 @@ class FrameSummary:
def __iter__(self) -> Iterator[Any]: ...
def __eq__(self, other: object) -> bool: ...
def __len__(self) -> Literal[4]: ...
__hash__: ClassVar[None] # type: ignore[assignment]
class StackSummary(list[FrameSummary]):
@classmethod