Skip to content

warn_unused_ignores is too sensitive: false positives #4412

Open
@mitar

Description

@mitar

If two packages both ignore an import, then one gets a false positive "unused ignore" error if warn_unused_ignores is enabled.

Reproduction: https://github.com/mitar/mypy-unused-ignores-issue

$ mypy bar/
$ mypy foo/
bar/__init__.py:1: note: unused 'type: ignore' comment

There is no error in bar package, but if I call mypy on foo, then an error in bar appears, but it should not. (Just because foo imports bar, and both import same 3rd party package which is ignored, once in foo, once in bar.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions