@@ -31,7 +31,7 @@ flagged as an error.
3131 return type) are not type-checked, and even the most blatant type
3232 errors (e.g. ``2 + 'a' ``) pass silently. The solution is to add
3333 annotations. Where that isn't possible, functions without annotations
34- can be checked using `` --check-untyped-defs ` `.
34+ can be checked using :option: ` --check-untyped-defs <mypy --check-untyped-defs> `.
3535
3636 Example:
3737
@@ -73,17 +73,17 @@ flagged as an error.
7373 <https://github.com/python/typeshed/issues/285> `_ for the reason).
7474
7575- **Some imports may be silently ignored **. Another source of
76- unexpected ``Any `` values are the :ref: ` " --ignore-missing-imports"
77- <ignore-missing-imports>` and :ref: ` " --follow-imports=skip"
78- <follow-imports>` flags. When you use `` --ignore-missing-imports ` `,
76+ unexpected ``Any `` values are the :option: ` --ignore-missing-imports
77+ <mypy -- ignore-missing-imports> ` and :option: ` --follow-imports=skip
78+ <mypy -- follow-imports> ` flags. When you use :option: ` --ignore-missing-imports <mypy --ignore-missing-imports> `,
7979 any imported module that cannot be found is silently replaced with
80- ``Any ``. When using `` --follow-imports=skip ` ` the same is true for
80+ ``Any ``. When using :option: ` --follow-imports=skip <mypy --follow-imports> ` the same is true for
8181 modules for which a ``.py `` file is found but that are not specified
8282 on the command line. (If a ``.pyi `` stub is found it is always
8383 processed normally, regardless of the value of
84- `` --follow-imports ` `.) To help debug the former situation (no
85- module found at all) leave out `` --ignore-missing-imports ` `; to get
86- clarity about the latter use `` --follow-imports=error ` `. You can
84+ :option: ` --follow-imports <mypy --follow-imports> `.) To help debug the former situation (no
85+ module found at all) leave out :option: ` --ignore-missing-imports <mypy --ignore-missing-imports> `; to get
86+ clarity about the latter use :option: ` --follow-imports=error <mypy --follow-imports> `. You can
8787 read up about these and other useful flags in :ref: `command-line `.
8888
8989- **A function annotated as returning a non-optional type returns 'None'
@@ -418,7 +418,7 @@ Example:
418418
419419 Some other expressions exhibit similar behavior; in particular,
420420:py:data: `~typing.TYPE_CHECKING `, variables named ``MYPY ``, and any variable
421- whose name is passed to `` --always-true `` or `` --always-false ` `.
421+ whose name is passed to :option: ` --always-true <mypy --always-true> ` or :option: ` --always-false <mypy --always-false> `.
422422(However, ``True `` and ``False `` are not treated specially!)
423423
424424.. note ::
@@ -431,14 +431,14 @@ By default, mypy will use your current version of Python and your current
431431operating system as default values for ``sys.version_info `` and
432432``sys.platform ``.
433433
434- To target a different Python version, use the `` --python-version X.Y ` ` flag.
434+ To target a different Python version, use the :option: ` --python-version X.Y <mypy --python-version> ` flag.
435435For example, to verify your code typechecks if were run using Python 2, pass
436- in `` --python-version 2.7 ` ` from the command line. Note that you do not need
436+ in :option: ` --python-version 2.7 <mypy --python-version> ` from the command line. Note that you do not need
437437to have Python 2.7 installed to perform this check.
438438
439- To target a different operating system, use the `` --platform PLATFORM ` ` flag.
439+ To target a different operating system, use the :option: ` --platform PLATFORM <mypy --platform> ` flag.
440440For example, to verify your code typechecks if it were run in Windows, pass
441- in `` --platform win32 ` `. See the documentation for :py:data: `sys.platform `
441+ in :option: ` --platform win32 <mypy --platform> `. See the documentation for :py:data: `sys.platform `
442442for examples of valid platform parameters.
443443
444444.. _reveal-type :
0 commit comments