From 185bdad4c48353cfcc96ee5ca9e4d7e8617b21de Mon Sep 17 00:00:00 2001 From: whn <142425816+Whning0513@users.noreply.github.com> Date: Tue, 25 Aug 2026 14:28:00 +0800 Subject: [PATCH 1/2] docs: clarify strict_optional behavior --- docs/source/config_file.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index d5431b1476aa0..5d99e7e8f0d53 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -618,15 +618,15 @@ section of the command line docs. :type: boolean :default: True - Effectively disables checking of optional + When set to ``false``, effectively disables checking of optional types and ``None`` values. With this option, mypy doesn't generally check the use of ``None`` values -- it is treated as compatible with every type. .. warning:: - ``strict_optional = false`` is evil. Avoid using it and definitely do - not use it without understanding what it does. + ``strict_optional = false`` is not recommended. See + :ref:`strict_optional` for an explanation of its behavior. Configuring warnings From 6487c17422d9ac6a4abc6253631fa6caffe9e866 Mon Sep 17 00:00:00 2001 From: whn <142425816+Whning0513@users.noreply.github.com> Date: Tue, 25 Aug 2026 14:28:17 +0800 Subject: [PATCH 2/2] docs: clarify strict_optional behavior --- docs/source/command_line.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index b8e4c7c187ba4..49f2a7a782cfd 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -465,8 +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. + ``--no-strict-optional`` is not recommended. See + :ref:`strict_optional` for an explanation of its behavior. .. _configuring-warnings: