Skip to content

Commit 81e8940

Browse files
JukkaLGuido van Rossum
authored and
Guido van Rossum
committed
Document --new-semantic-analyzer (#7023)
1 parent 405f682 commit 81e8940

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

docs/source/command_line.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,19 @@ Miscellaneous
622622
have many scripts that import a large package, the behavior enabled
623623
by this flag is often more convenient.)
624624

625+
``--new-semantic-analyzer``
626+
This flag switches to an improved, experimental implementation of
627+
the *semantic analyzer* (the part of mypy that binds Python
628+
names to definitions). The old and the new semantic analyzers
629+
mostly behave identically. The new semantic analyzer is better at
630+
handling import cycles and forward references to definitions. It
631+
also fixes inconsistencies between the daemon and non-daemon modes,
632+
and it detects additional error conditions.
633+
634+
Likely, the next mypy release will use the new semantic analyzer by
635+
default, and the old semantic analyzer will be removed in the next
636+
release after that.
637+
625638
.. _PEP 420: https://www.python.org/dev/peps/pep-0420/
626639

627640
.. _PEP 561: https://www.python.org/dev/peps/pep-0561/

docs/source/config_file.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,7 @@ Miscellaneous
456456

457457
``verbosity`` (integer, default 0)
458458
Controls how much debug output will be generated. Higher numbers are more verbose.
459+
460+
``new_semantic_analyzer`` (bool, default False)
461+
Enables the experimental new semantic analyzer.
462+
(See :ref:`The mypy command line <command-line>` for more information.)

0 commit comments

Comments
 (0)