Skip to content

Commit 82d9477

Browse files
lenayoung8pre-commit-ci[bot]sterliakov
authored
Clarified strict documentation (python#18903)
Fixes python#18760 This documentation change basically clarifies strict's behavior as described in the issue, adding precedence of the strict flag with respect to other error-checking flags --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Stanislav Terliakov <[email protected]>
1 parent 9a52273 commit 82d9477

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/source/command_line.rst

+13-2
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,19 @@ of the above sections.
749749

750750
.. option:: --strict
751751

752-
This flag mode enables all optional error checking flags. You can see the
753-
list of flags enabled by strict mode in the full :option:`mypy --help` output.
752+
This flag mode enables a defined subset of optional error-checking flags.
753+
This subset primarily includes checks for inadvertent type unsoundness (i.e
754+
strict will catch type errors as long as intentional methods like type ignore
755+
or casting were not used.)
756+
757+
Note: the :option:`--warn-unreachable` flag
758+
is not automatically enabled by the strict flag.
759+
760+
The strict flag does not take precedence over other strict-related flags.
761+
Directly specifying a flag of alternate behavior will override the
762+
behavior of strict, regardless of the order in which they are passed.
763+
You can see the list of flags enabled by strict mode in the full
764+
:option:`mypy --help` output.
754765

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

0 commit comments

Comments
 (0)