Skip to content

Spurious note despite suppressing error #22230

Open

Description

@A5rocks

Bug Report

In some cases the note error kind can be different than the error it is linked to.

To Reproduce

class OnlyA:
    def __call__(self, other: "A") -> bool:
        return True


class A:
    __le__ = OnlyA()


def f(x: A, y: A | int) -> None:
    x <= y  # type: ignore[arg-type]

Expected Behavior

No output.

Actual Behavior

issue5.py:11: note: Right operand is of type "A | int"
issue5.py:11: note: Error code "operator" not covered by "type: ignore[arg-type]" comment
Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 2.4.0
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.13.13

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions