KEMBAR78
warn-unused-ignores doesn't fire when ignoring multiple codes · Issue #11157 · python/mypy · GitHub
Skip to content

warn-unused-ignores doesn't fire when ignoring multiple codes #11157

@spagh-eddie

Description

@spagh-eddie

To Reproduce

# test.py 

a = object()

def f() -> int:
    return a[b'c'] # type: ignore[index, override]

Expected Behavior

a is not indexable but ignored.
An error along the lines of unused "type: ignore" comment for override

Actual Behavior

% mypy --warn-unused-ignores test.py 
Success: no issues found in 1 source file

Your Environment

% mypy --version
mypy 0.910

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions