Skip to content

Clarified strict documentation #18903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,19 @@ of the above sections.

.. option:: --strict

This flag mode enables all optional error checking flags. You can see the
list of flags enabled by strict mode in the full :option:`mypy --help` output.
This flag mode enables a defined subset of optional error-checking flags.
This subset primarily includes checks for inadvertent type unsoundness (i.e
strict will catch type errors as long as intentional methods like type ignore
or casting were not used.)

Note: the :option:`--warn-unreachable` flag
is not automatically enabled by the strict flag.

The strict flag does not take precedence over other strict-related flags.
Directly specifying a flag of alternate behavior will override the
behavior of strict, regardless of the order in which they are passed.
You can see the list of flags enabled by strict mode in the full
:option:`mypy --help` output.

Note: the exact list of flags enabled by running :option:`--strict` may change
over time.
Expand Down