python / python/mypy

--python-version 3.9 should warn about generic usages

Open
#10,971 5 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

Feature

From the Python documentation:

The redundant types are deprecated as of Python 3.9 but no deprecation warnings will be issued by the interpreter. It is expected that type checkers will flag the deprecated types when the checked program targets Python 3.9 or newer.

However that does not seem to be the case with mypy even if it's run with --python-version 3.9.

Pitch

Currently there is no way to learn about these deprecation warnings in automated way, because they're not issued by anything, which makes making the code future-proof a hassle.

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

Start by tracing how mypy handles the --python-version 3.9 target and where it analyzes generic type usages. Compare that behavior with the Python documentation’s deprecated redundant types, then add diagnostics for the targeted usages and verify that warnings appear when checking code against Python 3.9.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.