-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Should object.__hash__
be Callable[[], int] | None
if None
is a valid and common usage?
#6243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue a 8000 nd 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
Comments
Everything we do about class Foo:
pass
print(Foo().__hash__()) # prints an int
class Bar:
def __eq__(self, other):
return True
Bar().__hash__() # `NoneType` object is not callable I believe the best solution for this problem is to special-case type checkers so that |
Related python/mypy#11495 |
ftynse
pushed a commit
to llvm/llvm-project
that referenced
this issue
Mar 31, 2022
This commit fixes or disables all errors reported by python3 -m mypy -p mlir --show-error-codes Note that unhashable types cannot be currently expressed in a way compatible with typeshed. See python/typeshed#6243 for details. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D122790
mem-frob
pushed a commit
to draperlaboratory/hope-llvm-project
that referenced
this issue
Oct 7, 2022
This commit fixes or disables all errors reported by python3 -m mypy -p mlir --show-error-codes Note that unhashable types cannot be currently expressed in a way compatible with typeshed. See python/typeshed#6243 for details. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D122790
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently you have to
type: ignore
it.related: #3884
The text was updated successfully, but these errors were encountered: