Skip to content

Commit 7e8213f

Browse files
authored
Update docs on extra_checks flag (#18537)
Fixes #16189 Few things here: * Soften a bit the language on the flag * Delete docs for old deprecated `strict_concatenate` option that is now part of `extra_checks` * Add a bit more motivation to the flag description * Update docs for `--strict` flag to mention `extra_checks` instead of `strict_concatenate` Note that the docs on config file option requested in the issue were added a while ago.
1 parent 065c8fa commit 7e8213f

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

docs/source/command_line.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,8 @@ of the above sections.
692692
.. option:: --extra-checks
693693

694694
This flag enables additional checks that are technically correct but may be
695-
impractical in real code. In particular, it prohibits partial overlap in
696-
``TypedDict`` updates, and makes arguments prepended via ``Concatenate``
697-
positional-only. For example:
695+
impractical. In particular, it prohibits partial overlap in ``TypedDict`` updates,
696+
and makes arguments prepended via ``Concatenate`` positional-only. For example:
698697

699698
.. code-block:: python
700699
@@ -717,6 +716,13 @@ of the above sections.
717716
bad: Bad = {"a": 0, "b": "no"}
718717
test(bad, bar)
719718
719+
In future more checks may be added to this flag if:
720+
721+
* The corresponding use cases are rare, thus not justifying a dedicated
722+
strictness flag.
723+
724+
* The new check cannot be supported as an opt-in error code.
725+
720726
.. option:: --strict
721727

722728
This flag mode enables all optional error checking flags. You can see the

docs/source/config_file.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ section of the command line docs.
748748
:type: boolean
749749
:default: False
750750

751-
This flag enables additional checks that are technically correct but may be impractical in real code.
751+
This flag enables additional checks that are technically correct but may be impractical.
752752
See :option:`mypy --extra-checks` for more info.
753753

754754
.. confval:: implicit_reexport
@@ -771,13 +771,6 @@ section of the command line docs.
771771
from foo import bar
772772
__all__ = ['bar']
773773
774-
.. confval:: strict_concatenate
775-
776-
:type: boolean
777-
:default: False
778-
779-
Make arguments prepended via ``Concatenate`` be truly positional-only.
780-
781774
.. confval:: strict_equality
782775

783776
:type: boolean

docs/source/existing_code.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ The following config is equivalent to ``--strict`` (as of mypy 1.0):
199199
warn_redundant_casts = True
200200
warn_unused_ignores = True
201201
202-
# Getting these passing should be easy
202+
# Getting this passing should be easy
203203
strict_equality = True
204-
strict_concatenate = True
205204
206205
# Strongly recommend enabling this one as soon as you can
207206
check_untyped_defs = True
@@ -223,6 +222,10 @@ The following config is equivalent to ``--strict`` (as of mypy 1.0):
223222
# This one can be tricky to get passing if you use a lot of untyped libraries
224223
warn_return_any = True
225224
225+
# This one is a catch-all flag for the rest of strict checks that are technically
226+
# correct but may not be practical
227+
extra_checks = True
228+
226229
Note that you can also start with ``--strict`` and subtract, for instance:
227230

228231
.. code-block:: text

0 commit comments

Comments
 (0)