Use error subcodes to differentiate import errors by hauntsaninja · Pull Request #14740 · python/mypy (original) (raw)
Resolves #9789
Users could use --disable-error-code=import-untyped
to only ignore errors about libraries not having stubs, but continue to get errors about e.g. typos in an import name.
The error subcode mechanism is new from #14570. Note that users will now get a different error code depending on whether or not a package is installed, and may not know that they can use the parent error code to ignore the issue regardless. I think this is okay, in general type checking results can change if you run them in two different environments. Note also that with --warn-unused-ignore
/ --strict
mypy will complain about not having the most specific error code