python / python/mypy

Provide an easy way to opt out of changes to default options

Open
#17,989 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We are planning to change the defaults of some options in mypy 2.0, and it's likely that we'll have more such changes in mypy 3.0 and so on. Some of these require work from many users, for example if we enable a check by default that generates lots of errors (even if they are mostly correct).

Here are some things we might want to change the future:

  • Enable various optional error codes by default
  • Check bodies of untyped defs by default
  • Enable flags that improve conformance to standards but that break backward compatibility
  • Changes to checks enabled by --strict

I think we could provide a way to freeze options to the current level, so that users wouldn't need to touch their config files (or fix issues) on each major feature release. For example, --defaults=1.x could tell mypy to use the defaults mypy versions 1.x use. This could also be set in the config file.

This would make it easier for us to make changes to defaults, and easier for users to adopt these changes at their own pace, while still getting access to new Python versions and new mypy features.

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 mapping how mypy defines and loads default options and configuration, then determine how versioned defaults would interact with optional error codes, untyped-definition checks, standards flags, and --strict. Done means a documented, maintainable opt-out mechanism is specified and its behavior across future releases is covered.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.