From b3e3f563d18d4ae8dd24220bb5ffa9a8923443ad Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 5 Sep 2023 14:13:22 +0300 Subject: [PATCH 1/3] Document `force_union_syntax` and `force_lowercase_builtins` --- docs/source/config_file.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index c0798bbf03f1..1335ba0cfdcf 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -816,6 +816,19 @@ These options may only be set in the global section (``[mypy]``). Show absolute paths to files. +.. confval:: force_lowercase_builtins + + :type: boolean + :default: False + + Force to use ``List`` instead of ``list`` . + +.. confval:: force_union_syntax + + :type: boolean + :default: False + + Force to use ``Union[]`` type instead of ``|`` operator. Incremental mode **************** From 3d2b2477ca24d4b557c77eff9bc5c33850281b12 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 5 Sep 2023 14:29:44 +0300 Subject: [PATCH 2/3] Typo --- docs/source/config_file.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index 1335ba0cfdcf..b74bc8db36f1 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -816,12 +816,12 @@ These options may only be set in the global section (``[mypy]``). Show absolute paths to files. -.. confval:: force_lowercase_builtins +.. confval:: force_uppercase_builtins :type: boolean :default: False - Force to use ``List`` instead of ``list`` . + Force to use ``List`` instead of ``list``. .. confval:: force_union_syntax From 44fcc2fbba34b0ccb7badc3ead14fe478c40d478 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 5 Sep 2023 14:36:38 +0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Alex Waygood --- docs/source/config_file.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index b74bc8db36f1..b5ce23ff11ec 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -821,14 +821,17 @@ These options may only be set in the global section (``[mypy]``). :type: boolean :default: False - Force to use ``List`` instead of ``list``. + Always use ``List`` instead of ``list`` in error messages, + even on Python 3.9+. .. confval:: force_union_syntax :type: boolean :default: False - Force to use ``Union[]`` type instead of ``|`` operator. + Always use ``Union[]`` and ``Optional[]`` for union types + in error messages (instead of the ``|`` operator), + even on Python 3.10+. Incremental mode ****************