python / python/mypy

Syntax for ignoring error due to an issue

Open
#15,175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Sometimes you want to ignore an error stemming from a known mypy issue. Commenting with # type:ignore[issue-12345] would do that.

Behavior:

  • If mypy does not have the issue closed, ignore errors on that line.
  • If mypy has the issue closed, no longer ignore errors on that line, but also don't deem it as unused ignore (which is what would happen if you just # type: ignore and run with warn_unused_ignore).

To make it happen, mypy would ship with an ever-growing list of closed issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Start by locating mypy's handling of # type: ignore comments and issue identifiers, then determine how closed issues would be tracked. Done means unresolved issue references suppress errors, while closed references stop suppressing errors without triggering an unused-ignore warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.