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

@@ -1,6 +1,6 @@
from _typeshed import Incomplete, StrPath
from collections.abc import Iterable, Iterator
from typing import IO, NoReturn, overload
from typing import IO, ClassVar, NoReturn, overload
from . import grammar
from .tokenize import _TokenInfo
@@ -46,5 +46,6 @@ class DFAState:
def addarc(self, next: DFAState, label: str) -> None: ...
def unifystate(self, old: DFAState, new: DFAState) -> None: ...
def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override]
__hash__: ClassVar[None] # type: ignore[assignment]
def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ...

View File

@@ -1,7 +1,7 @@
from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused
from abc import abstractmethod
from collections.abc import Iterable, Iterator, MutableSequence
from typing import Final
from typing import ClassVar, Final
from typing_extensions import Self, TypeAlias
from .fixer_base import BaseFix
@@ -24,6 +24,7 @@ class Base:
was_changed: bool
was_checked: bool
def __eq__(self, other: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]
@abstractmethod
def _eq(self, other: Base) -> bool: ...
@abstractmethod