Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small doc improvements for conditional overloads #12283

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/source/more_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mypy --always-true>`
:ref:`version_and_platform_checks`, :option:`--always-true <mypy --always-true>`
JelleZijlstra marked this conversation as resolved.
Show resolved Hide resolved
and :option:`--always-false <mypy --always-false>` values.

.. code-block:: python
Expand Down Expand Up @@ -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

Expand Down