-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Maint: Typing and ImportError -> ModuleNotFoundError. #5431
Conversation
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Codecov Report
@@ Coverage Diff @@
## main #5431 +/- ##
==========================================
- Coverage 89.16% 89.10% -0.07%
==========================================
Files 584 597 +13
Lines 49515 50624 +1109
==========================================
+ Hits 44151 45107 +956
- Misses 5364 5517 +153
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM, curious what other core devs think
(I also see some harmless improvement in typing changes not captured in the PR description)
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed. In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.
Module not found is more specific than Import Error, and allows to bubble errors when the issue is not that the module is not installed.
In the same vein it is an anti pattern to use try/except for conditional import, as it may hide errors in Python install, using a explicit compare with sys.version_info, can allow some tools (like pyupgrade) to detect dead branches.