Skip to content

Conversation

@njg7194
Copy link

@njg7194 njg7194 commented Feb 1, 2026

Summary

This PR enables the --pretty option by default, making mypy show visually nicer error messages with source code snippets and error location markers.

Changes

  • Changed default value of self.pretty from False to True in mypy/options.py
  • Updated documentation in docs/source/command_line.rst to reflect the new default
  • Updated documentation in docs/source/config_file.rst to show default: True

Behavior

Before (default):

foo.py:13: error: List item 0 has incompatible type "str"; expected "int"  [list-item]

After (new default):

foo.py:13: error: List item 0 has incompatible type "str"; expected "int"  [list-item]
    aa = ["x"]
          ^~~

Users can still use --no-pretty to get the previous concise output format.

Closes #19108

This change enables the --pretty option by default, which shows visually
nicer error messages with source code snippets and error location markers.

Users can still use --no-pretty to get the previous concise output format.

Closes python#19108
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@wyattscarpenter
Copy link
Contributor

The problem is fixing the test errors, which is what makes #19510 so complicated. Maybe you will find an easier way. But it may be quite difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable --pretty by default

2 participants