You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything we do about __hash__() is problematic, because of its Schrödinger's nature:
classFoo:
passprint(Foo().__hash__()) # prints an intclassBar:
def__eq__(self, other):
returnTrueBar().__hash__() # `NoneType` object is not callable
I believe the best solution for this problem is to special-case type checkers so that __hash__: None is a valid construct in stubs and you don't need # type: ignore for that. I commented as such on python/mypy#11465.
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
Currently you have to
type: ignore
it.related: #3884
The text was updated successfully, but these errors were encountered: