From 195243067a279717d9960494a86bf180f429b500 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Thu, 3 Mar 2022 13:34:18 +0100 Subject: [PATCH 1/2] Small doc improvements for conditional overloads --- docs/source/more_types.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/more_types.rst b/docs/source/more_types.rst index 11c5643705ad..580b4b6c4a64 100644 --- a/docs/source/more_types.rst +++ b/docs/source/more_types.rst @@ -593,7 +593,7 @@ For example, there must be at least two overloads. Mypy can only infer a limited number of conditions. Supported ones currently include :py:data:`~typing.TYPE_CHECKING`, ``MYPY``, - :ref:`version_and_platform_checks`, and :option:`--always-true ` + :ref:`version_and_platform_checks`, :option:`--always-true ` and :option:`--always-false ` values. .. code-block:: python @@ -666,7 +666,8 @@ For example, there must be at least two overloads. The overloads for ``A`` and ``C`` are ignored! The overload for ``D`` is not defined conditionally and thus is also added. -When mypy cannot infer a condition to be always True or always False, an error is emitted. +When mypy cannot infer a condition to be always ``True`` or always ``False``, +an error is emitted. .. code-block:: python From c7a130ff950ea47fe67ba9e0bbac2b711fee84cd Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 3 Mar 2022 07:23:58 -0800 Subject: [PATCH 2/2] Update docs/source/more_types.rst --- docs/source/more_types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/more_types.rst b/docs/source/more_types.rst index 580b4b6c4a64..2203022ad73f 100644 --- a/docs/source/more_types.rst +++ b/docs/source/more_types.rst @@ -593,7 +593,7 @@ For example, there must be at least two overloads. Mypy can only infer a limited number of conditions. Supported ones currently include :py:data:`~typing.TYPE_CHECKING`, ``MYPY``, - :ref:`version_and_platform_checks`, :option:`--always-true ` + :ref:`version_and_platform_checks`, :option:`--always-true `, and :option:`--always-false ` values. .. code-block:: python