python / python/mypy

Reconsider `--extra-checks`

Open
#18,070 4 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

--extra-checks was added per this review comment: https://github.com/python/mypy/pull/15425#issuecomment-1604275753

I think a big advantage of mypy relative to other type checkers is that it is relatively configurable. mypy's always had a number of config flags and the error code system that we've been encouraging allows users to enable and disable errors with granularity.

--extra-checks is not self-descriptive, it's not immediately obvious what it turns on or off. If I was a user and ran into a false positive/negative, I would not be able to connect it with the option. It's also part of --strict, so it's not even that extra — most users serious enough about type checking to know what the flag does will already have it on. I vote we keep --strict-concatenate and add --strict-typeddict-update. We can keep both of these as part of --strict and keep --extra-checks for backwards compatibility.

If we want to do more bundling of flags / error codes, I feel we should generalise --strict.

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 reading the linked review comment and the current handling of --extra-checks and --strict. Compare the proposed --strict-concatenate and --strict-typeddict-update organization with the backwards-compatibility requirement; done means the flag design and any broader bundling decision are documented and agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.