class A:
def __eq__(self, o: object, /) -> bool:
return self is o
reveal_type(A().__hash__) # def () -> builtins.int
>>> class A:
... def __eq__(self, o: object, /) -> bool:
... return self is o
...
>>> type(A.__hash__)
<class 'NoneType'>
iff. class A, and only class A (i.e. excluding any base classes)
problem
https://mypy-play.net/?mypy=latest&python=3.13&flags=strict%2Clocal-partial-types&gist=2b23624b1df772175b70c08e36a6e912
yet
solution
iff. class
A, and only classA(i.e. excluding any base classes)__eq__, and__hash__infer
A.__hash__: ClassVar[None]