-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
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
Non-hashable types should declare __hash__: None in typeshed #2148
Comments
I tried doing this in #2221, but I get errors like:
We probably need some more special casing in mypy first. |
Yes. This particular one can be fixed by changing definition on |
Can you file a separate mypy issue for that? Having that fixes is a prerequisite for fixing this (and hence for #2221). |
mypy issue is now python/mypy#4266. |
Note that this can also cause false positives, see python/mypy#7328. Honestly, I don't think having few |
So from what I understand we would add |
Yes, or maybe better |
Based on @JelleZijlstra's PR python#2221. Fixes python#2148
Based on @JelleZijlstra's PR #2221. Fixes #2148
Currently this passes mypy:
A possible solution may be to add
__hash__: None
to non-hashable types likelist
.The text was updated successfully, but these errors were encountered: