Type ignore comments erroneously marked as unused by dmypy by meshy · Pull Request #15043 · python/mypy
changed the title
Type ignores comments erroneously marked as unused by dmypy
Type ignore comments erroneously marked as unused by dmypy
meshy
mentioned this pull request
meshy
mentioned this pull request
meshy
mentioned this pull request
meshy
mentioned this pull request
The problem this solved has been addressed in another way, so we don't need to do this re-analysis any more in order to fix the bug we've been chasing. This change is a partial revert of "Fix disappearing errors when re-running dmypy check" from a few commits back.
meshy
mentioned this pull request
esarp pushed a commit that referenced this pull request
Jul 3, 2025There is currently a misbehaviour where "type: ignore" comments are erroneously marked as unused in re-runs of dmypy. There are also cases where errors disappear on the re-run. As far as I can tell, this only happens in modules which contain an import that we don't know how to type (such as a module which does not exist), and a submodule which is unused. There was a lot of commenting and investigation on this PR, but I hope that the committed tests and fixes illustrate and address the issue. Related to #9655 --------- Co-authored-by: David Seddon <david@seddonym.me> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters