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, even with --follow-imports=skip imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked.
Consider the following example:
# main.pyfromstubimportx
# stub.pyifromunanalyzedimportx
# unanalyzed.pyx: int=42x+''# error is reported here but it shouldn't be because this file is unanalyzed
Currently, if you run mypy the following happens:
$ mypy main.py --follow-imports=skip
unanalyzed.py:4: error: Unsupported operand types for + ("int" and "str")
I think we should treat imports from stub and non-stub files the same way. Following imports from stubs in silent mode was implemented #1372.
Discovered this bug when investigating an error in Dropbox internal codebases.
The text was updated successfully, but these errors were encountered:
Hm, reading through the original discussion in #1364 and #1372 I agree that this is an iffy feature and I'm fine with rolling it back. I don't think this was ever documented -- I don't even recall being aware of this corner case when I refactored --silent/-s into --follow-imports=<enum> and --ignore-missing-imports.
ilinum
added a commit
to ilinum/mypy
that referenced
this issue
Jul 19, 2017
Currently, even with
--follow-imports=skip
imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked.Consider the following example:
Currently, if you run mypy the following happens:
I think we should treat imports from stub and non-stub files the same way. Following imports from stubs in silent mode was implemented #1372.
Discovered this bug when investigating an error in Dropbox internal codebases.
The text was updated successfully, but these errors were encountered: