python / python/mypy

Enable --warn-unreachable in --strict in Mypy 2.0

Open
#18,078 8 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-configuration topic-reachability
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

It is questionable why --strict does not just enable --warn-unreachable. A lot of people probably think "I'm running --strict, there's nothing else important to enable".

@sobolevn told me to create this issue in https://github.com/python/mypy/pull/18076#issuecomment-2449506357

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 locating Mypy’s handling of the --strict and --warn-unreachable options and the tests covering strict-mode defaults. Verify the expected Mypy 2.0 behavior, then update the relevant tests so completion means --strict enables --warn-unreachable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.