Skip to content

Commit 5e77c3e

Browse files
dfrogerDavid Froger
andauthored
Document --enable-incomplete-feature possible values in "mypy --help" (#16661)
By the way, also remove `--enable-incomplete-feature=Unpack --enable-incomplete-feature=TypeVarTuple` when running the tests, as they are no more incomplete features. Fixes #14452 Co-authored-by: David Froger <[email protected]>
1 parent 09cb2d1 commit 5e77c3e

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

docs/source/command_line.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ format into the specified directory.
995995
Enabling incomplete/experimental features
996996
*****************************************
997997

998-
.. option:: --enable-incomplete-feature FEATURE
998+
.. option:: --enable-incomplete-feature {PreciseTupleTypes}
999999

10001000
Some features may require several mypy releases to implement, for example
10011001
due to their complexity, potential for backwards incompatibility, or

mypy/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def add_invertible_flag(
10101010
parser.add_argument(
10111011
"--enable-incomplete-feature",
10121012
action="append",
1013-
metavar="FEATURE",
1013+
metavar="{" + ",".join(sorted(INCOMPLETE_FEATURES)) + "}",
10141014
help="Enable support of incomplete/experimental features for early preview",
10151015
)
10161016
internals_group.add_argument(

mypyc/test/test_run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from mypy import build
1717
from mypy.errors import CompileError
18-
from mypy.options import TYPE_VAR_TUPLE, UNPACK, Options
18+
from mypy.options import Options
1919
from mypy.test.config import test_temp_dir
2020
from mypy.test.data import DataDrivenTestCase
2121
from mypy.test.helpers import assert_module_equivalence, perform_file_operations
@@ -194,7 +194,6 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
194194
options.preserve_asts = True
195195
options.allow_empty_bodies = True
196196
options.incremental = self.separate
197-
options.enable_incomplete_feature = [TYPE_VAR_TUPLE, UNPACK]
198197

199198
# Avoid checking modules/packages named 'unchecked', to provide a way
200199
# to test interacting with code we don't have types for.

test-data/unit/pythoneval.test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ _testInferenceOfDunderDictOnClassObjects.py:4: error: Property "__dict__" define
20072007
_testInferenceOfDunderDictOnClassObjects.py:4: error: Incompatible types in assignment (expression has type "Dict[Never, Never]", variable has type "MappingProxyType[str, Any]")
20082008

20092009
[case testTypeVarTuple]
2010-
# flags: --enable-incomplete-feature=TypeVarTuple --enable-incomplete-feature=Unpack --python-version=3.11
2010+
# flags: --python-version=3.11
20112011
from typing import Any, Callable, Unpack, TypeVarTuple
20122012

20132013
Ts = TypeVarTuple("Ts")
@@ -2019,7 +2019,6 @@ def call(callback: Callable[[Unpack[Ts]], Any], *args: Unpack[Ts]) -> Any:
20192019
...
20202020

20212021
[case testTypeVarTupleTypingExtensions]
2022-
# flags: --enable-incomplete-feature=TypeVarTuple --enable-incomplete-feature=Unpack
20232022
from typing_extensions import Unpack, TypeVarTuple
20242023
from typing import Any, Callable
20252024

0 commit comments

Comments
 (0)