-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Do not display import-related errors after module-level always false assert #19347
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?
Do not display import-related errors after module-level always false assert #19347
Conversation
This comment has been minimized.
This comment has been minimized.
One reason I'm surprised about this is that my impression was that after a module-level assert that is unreachable, mypy removes all nodes. Am I misremembering? Or is this an earlier pass? |
@A5rocks Great question. Imports are collected during parsing, and "definitely unreachable" truncation step follows ( |
This comment has been minimized.
This comment has been minimized.
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 makes sense to me!
Diff from mypy_primer, showing the effect of this PR on open source code: PyWinCtl (https://github.com/Kalmat/PyWinCtl)
- src/pywinctl/_pywinctl_win.py:28: error: Cannot find implementation or library stub for module named "pywinbox" [import-not-found]
- src/pywinctl/_pywinctl_macos.py:25: error: Cannot find implementation or library stub for module named "pywinbox" [import-not-found]
|
Fixes #19346