-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Uninhabited should have all attributes #19300
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
For me While I understand your motivation, I think it's completely impractical here. Furthermore, if I'm not mistaken, the |
I think this change is good (and there's like 2 other similar places), especially if combined something that marks any block with a variable bound to Never as unreachable. Edit: Nevermind I see you address that w/r/t |
Well, then we won't see " I see some merit in saying "we do indicate some important issues via |
Yes, I think we should actually enable that one as well. I am actually going to try that now. |
Diff from mypy_primer, showing the effect of this PR on open source code: Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/clients.py:2294: error: "Never" has no attribute "__iter__" (not iterable) [attr-defined]
ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/relations.py:1041: error: "Never" has no attribute "__next__" [attr-defined]
prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/server/models/deployments.py:63: error: "Never" has no attribute "name" [attr-defined]
- src/prefect/server/models/deployments.py:767: error: "Never" has no attribute "model_dump" [attr-defined]
manticore (https://github.com/trailofbits/manticore)
+ manticore/wasm/types.py:56: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/variable.py:922: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/variable.py:924: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/variable.py:2807: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/variable.py:2809: error: Unused "type: ignore" comment [unused-ignore]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems consistent now. I'm still not the biggest fan of this idea, but I have --warn-unreachable
enabled everywhere so shouldn't be bitten too painfully.
Although this can hide some mypy bugs, TBH this always bothered me as something conceptually wrong. The work on
checkmember
stuff inspired me to actually try it.