Skip to content

Crossreferences to standard library in mypy docs #7652

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

Merged
merged 6 commits into from
Oct 8, 2019
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
Prev Previous commit
Next Next commit
revisited command_line.rst
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
  • Loading branch information
hoefling committed Oct 8, 2019
commit 414a1f03fbdcc8bf08e841b98cdf0341231f5002
28 changes: 14 additions & 14 deletions docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ imports.
``--python-executable EXECUTABLE``
This flag will have mypy collect type information from :pep:`561`
compliant packages installed for the Python executable ``EXECUTABLE``.
If not provided, mypy will use :pep:`561` compliant packages installed for
If not provided, mypy will use PEP 561 compliant packages installed for
the Python executable running mypy.

See :ref:`installed-packages` for more on making :pep:`561` compliant packages.
See :ref:`installed-packages` for more on making PEP 561 compliant packages.

``--no-site-packages``
This flag will disable searching for :pep:`561` compliant packages. This
will also disable searching for a usable Python executable.

Use this flag if mypy cannot find a Python executable for the version of
Python being checked, and you don't need to use :pep:`561` typed packages.
Python being checked, and you don't need to use PEP 561 typed packages.
Otherwise, use ``--python-executable``.

``--no-silence-site-packages``
Expand Down Expand Up @@ -213,7 +213,7 @@ The following options are available:
This flag disallows all expressions in the module that have type ``Any``.
If an expression of type ``Any`` appears anywhere in the module
mypy will output an error unless the expression is immediately
used as an argument to ``cast`` or assigned to a variable with an
used as an argument to :py:func:`~typing.cast` or assigned to a variable with an
explicit type annotation.

In addition, declaring a variable of type ``Any``
Expand All @@ -230,9 +230,9 @@ The following options are available:

``--disallow-any-generics``
This flag disallows usage of generic types that do not specify explicit
type parameters. Moreover, built-in collections (such as ``list`` and
``dict``) become disallowed as you should use their aliases from the typing
module (such as ``List[int]`` and ``Dict[str, str]``).
type parameters. Moreover, built-in collections (such as :py:class:`list` and
:py:class:`dict`) become disallowed as you should use their aliases from the :py:mod:`typing`
module (such as :py:class:`List[int] <typing.List>` and :py:class:`Dict[str, str] <typing.Dict>`).

``--disallow-subclassing-any``
This flag reports an error whenever a class subclasses a value of
Expand Down Expand Up @@ -292,7 +292,7 @@ For more details, see :ref:`no_strict_optional`.

``--no-implicit-optional``
This flag causes mypy to stop treating arguments with a ``None``
default value as having an implicit ``Optional[...]`` type.
default value as having an implicit :py:data:`Optional[...] <typing.Optional>` type.

For example, by default mypy will assume that the ``x`` parameter
is of type ``Optional[int]`` in the code snippet below since
Expand All @@ -312,7 +312,7 @@ For more details, see :ref:`no_strict_optional`.
print(x)

``--no-strict-optional``
This flag disables strict checking of ``Optional[...]``
This flag disables strict checking of :py:data:`Optional[...] <typing.Optional>`
types and ``None`` values. With this option, mypy doesn't
generally check the use of ``None`` values -- they are valid
everywhere. See :ref:`no_strict_optional` for more about this feature.
Expand Down Expand Up @@ -362,7 +362,7 @@ potentially problematic or redundant in some way.

``--warn-return-any``
This flag causes mypy to generate a warning when returning a value
with type ``Any`` from a function declared with a non- ``Any`` return type.
with type ``Any`` from a function declared with a non-``Any`` return type.

``--warn-unreachable``
This flag will make mypy report an error whenever it encounters
Expand All @@ -387,7 +387,7 @@ potentially problematic or redundant in some way.
unreachable" warning will be silenced in exactly two cases:

1. When the unreachable statement is a ``raise`` statement, is an
``assert False`` statement, or calls a function that has the ``NoReturn``
``assert False`` statement, or calls a function that has the :py:data:`~typing.NoReturn`
return type hint. In other words, when the unreachable statement
throws an error or terminates the program in some way.
2. When the unreachable statement was *intentionally* marked as unreachable
Expand Down Expand Up @@ -578,7 +578,7 @@ in developing or debugging mypy internals.

``--custom-typing MODULE``
This flag lets you use a custom module as a substitute for the
``typing`` module.
:py:mod:`typing` module.

``--custom-typeshed-dir DIR``
This flag specifies the directory where mypy looks for typeshed
Expand Down Expand Up @@ -673,10 +673,10 @@ Miscellaneous
This flag will give command line arguments that appear to be
scripts (i.e. files whose name does not end in ``.py``)
a module name derived from the script name rather than the fixed
name ``__main__``.
name :py:mod:`__main__`.

This lets you check more than one script in a single mypy invocation.
(The default ``__main__`` is technically more correct, but if you
(The default :py:mod:`__main__` is technically more correct, but if you
have many scripts that import a large package, the behavior enabled
by this flag is often more convenient.)

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy