diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index b8e4c7c187ba..104de1707b06 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -267,6 +267,11 @@ For more information on how to use these flags, see :ref:`version_and_platform_c run under Python version X.Y. Without this option, mypy will default to using whatever version of Python is running mypy. + This flag affects type checking behavior such as version and platform + checks, but mypy still uses the parser from the Python interpreter running + mypy. To type check code using syntax from a newer Python version, run mypy + with an interpreter that supports that syntax. + This flag will attempt to find a Python executable of the corresponding version to search for :pep:`561` compliant packages. If you'd like to disable this, use the :option:`--no-site-packages` flag (see diff --git a/docs/source/config_file.rst b/docs/source/config_file.rst index d5431b1476aa..b181c0169ed2 100644 --- a/docs/source/config_file.rst +++ b/docs/source/config_file.rst @@ -435,6 +435,11 @@ Platform configuration for example ``3.10``. The default is the version of the Python interpreter used to run mypy. + This setting affects type checking behavior such as version and platform + checks, but mypy still uses the parser from the Python interpreter running + mypy. To type check code using syntax from a newer Python version, run mypy + with an interpreter that supports that syntax. + This option may only be set in the global section (``[mypy]``). .. confval:: platform