We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__eq__
__hash__
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class A: def __eq__(self, o: object, /) -> bool: return self is o reveal_type(A().__hash__) # def () -> builtins.int
https://mypy-play.net/?mypy=latest&python=3.13&flags=strict%2Clocal-partial-types&gist=2b23624b1df772175b70c08e36a6e912
yet
>>> 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)
A
infer A.__hash__: ClassVar[None]
A.__hash__: ClassVar[None]
The text was updated successfully, but these errors were encountered:
@override
__init__.pyi
dtypes.pyi
_just.pyi
__hash__ = None
Successfully merging a pull request may close this issue.
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]
The text was updated successfully, but these errors were encountered: