Skip to content

Commit 0f9d1cd

Browse files
Clarify python_version parser behavior
1 parent 1100800 commit 0f9d1cd

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

docs/source/command_line.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ For more information on how to use these flags, see :ref:`version_and_platform_c
267267
run under Python version X.Y. Without this option, mypy will default to using
268268
whatever version of Python is running mypy.
269269

270+
This flag affects type checking behavior such as version and platform
271+
checks, but mypy still uses the parser from the Python interpreter running
272+
mypy. To type check code using syntax from a newer Python version, run mypy
273+
with an interpreter that supports that syntax.
274+
270275
This flag will attempt to find a Python executable of the corresponding
271276
version to search for :pep:`561` compliant packages. If you'd like to
272277
disable this, use the :option:`--no-site-packages` flag (see

docs/source/config_file.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ Platform configuration
435435
for example ``3.10``. The default is the version of the Python
436436
interpreter used to run mypy.
437437

438+
This setting affects type checking behavior such as version and platform
439+
checks, but mypy still uses the parser from the Python interpreter running
440+
mypy. To type check code using syntax from a newer Python version, run mypy
441+
with an interpreter that supports that syntax.
442+
438443
This option may only be set in the global section (``[mypy]``).
439444

440445
.. confval:: platform

0 commit comments

Comments
 (0)