From 74ad7d7c3994ba3d713a84a88b88629752b75c47 Mon Sep 17 00:00:00 2001 From: Anvesh <19anveshh@gmail.com> Date: Thu, 29 Oct 2026 21:45:13 +0530 Subject: [PATCH 1/2] Fix #21658: cross-reference strict_optional docs between config and CLI --- docs/source/command_line.rst | 3 ++- docs/source/config_file.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 5a674af4ee579..4c00fe9b1ed27 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -465,7 +465,8 @@ The following flags adjust how mypy handles values of type ``None``. .. warning:: ``--no-strict-optional`` is evil. Avoid using it and definitely do - not use it without understanding what it does. + not use it without understanding what it does. See also the + :confval:`strict_optional` config file option. .. _configuring-warnings: diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 18bb32d0d02c1..447aca01bc873 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -626,7 +626,8 @@ section of the command line docs. .. warning:: ``strict_optional = false`` is evil. Avoid using it and definitely do - not use it without understanding what it does. + not use it without understanding what it does. See also the + :option:`--no-strict-optional` command-line flag. Configuring warnings From f29fc63e754b920576e7dea11fa7c96f314f1dbe Mon Sep 17 00:00:00 2001 From: Anvesh <19anveshh@gmail.com> Date: Thu, 29 Oct 2026 23:24:06 +0530 Subject: [PATCH 2/2] Fix strict optional command-line cross-reference Fixes #21658. --- docs/source/config_file.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 447aca01bc873..3ab90404e62b4 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -627,7 +627,7 @@ section of the command line docs. ``strict_optional = false`` is evil. Avoid using it and definitely do not use it without understanding what it does. See also the - :option:`--no-strict-optional` command-line flag. + :option:`--no-strict-optional ` command-line flag. Configuring warnings