python / python/mypy

--warn-annotation-comments

Open
#7,486 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature needs discussion priority-2-low
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

I think having a linter option warning about old-style type comment annotations, instead of PEP 3107/526 annotations, would be useful. (With the obvious exception of # type: ignore comments.) This is potentially something that would make more sense in linters like flake8, but mypy also feels like a natural place where such an option could exist.

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. Start by locating mypy's command-line option handling and its processing of type comments and PEP 3107/526 annotations. Done means a configurable warning for old-style type comment annotations, while excluding # type: ignore, with tests covering the warning behavior.

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
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.