Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment has been minimized.
This comment has been minimized.
sterliakov commentedJun 15, 2025
For me While I understand your motivation, I think it's completely impractical here. Furthermore, if I'm not mistaken, the |
A5rocks commentedJun 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 |
sterliakov commentedJun 16, 2025
Well, then we won't see " I see some merit in saying "we do indicate some important issues via |
ilevkivskyi commentedJun 24, 2025
Yes, I think we should actually enable that one as well. I am actually going to try that now. |
Diff frommypy_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] |
sterliakov left a comment
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.
JukkaL left a comment
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.
I agree that this is the most consistent way to do this. There are probably various other cases where we don't handleNoReturn, but this moves us into the right direction and covers many common cases.
abb1cc7 intopython:masterUh oh!
There was an error while loading.Please reload this page.
Although this can hide some mypy bugs, TBH this always bothered me as something conceptually wrong. The work on
checkmemberstuff inspired me to actually try it.