Skip to content

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

Open
@JukkaL

Description

@JukkaL

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions