Skip to content

Note log is emitted even if line is ignored #22271

Closed as duplicate
Closed as duplicate

Description

@kasium

Bug Report
Even if all errors are ignored using type: ignore comments, a note line is still printed, as its emitted on another line than the error.

To Reproduce

a:b
b =dict[0, b|0]  # type:ignore[valid-type]
a[0
]+"" # type:ignore[operator]

The code was generated from a closed source project using shrinkray

Expected Behavior

The line is not emitted.

Actual Behavior

foo.py:3:1: note: Left operand is of type "b | Any"
Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 2.4.0
  • Mypy command-line flags: mypy foo.py
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used: 3.14.0

Activity

  1. A5rocks commented on Oct 22, 2026

    @A5rocks
    Collaborator

    This might be a duplicate of #22230?

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

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions