You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when using --silent-imports (or the new alternative that is being worked on in #2513) mypy won't catch misspelled module names, and will silently accept them. Instead of skipping all modules that we can't find, another alternative would be to allow users to explicitly specify which modules don't exist or are missing a stub, and only skip imports of/from these modules.
A few ways this could be supported:
Add a command line and config file option to enumerate skipped modules.
Support partially-defined stubs through def __getattr__(name) -> Any: ... (defined in PEP 484). If this is defined for a stub, we should perhaps also allow arbitrary submodules to be imported. We could define local minimal stubs with only this __getattr__ definition for things for which there's no real stub.
I prefer option 2 since we already have a pretty large number of command-line options and this behavior is defined by PEP 484 (except for the behavior of submodules).
This is based on an issue reported by a user.
The text was updated successfully, but these errors were encountered:
Currently when using
--silent-imports
(or the new alternative that is being worked on in #2513) mypy won't catch misspelled module names, and will silently accept them. Instead of skipping all modules that we can't find, another alternative would be to allow users to explicitly specify which modules don't exist or are missing a stub, and only skip imports of/from these modules.A few ways this could be supported:
def __getattr__(name) -> Any: ...
(defined in PEP 484). If this is defined for a stub, we should perhaps also allow arbitrary submodules to be imported. We could define local minimal stubs with only this__getattr__
definition for things for which there's no real stub.I prefer option 2 since we already have a pretty large number of command-line options and this behavior is defined by PEP 484 (except for the behavior of submodules).
This is based on an issue reported by a user.
The text was updated successfully, but these errors were encountered: