diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index 09836e2ffd20..c8e0ef3df11f 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -995,7 +995,7 @@ format into the specified directory. Enabling incomplete/experimental features ***************************************** -.. option:: --enable-incomplete-feature FEATURE +.. option:: --enable-incomplete-feature {PreciseTupleTypes} Some features may require several mypy releases to implement, for example due to their complexity, potential for backwards incompatibility, or diff --git a/mypy/main.py b/mypy/main.py index 8a35c2056963..ee090a03d3cf 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1010,7 +1010,7 @@ def add_invertible_flag( parser.add_argument( "--enable-incomplete-feature", action="append", - metavar="FEATURE", + metavar="{" + ",".join(sorted(INCOMPLETE_FEATURES)) + "}", help="Enable support of incomplete/experimental features for early preview", ) internals_group.add_argument( diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py index f5c902bf3b3d..467ef8b87a92 100644 --- a/mypyc/test/test_run.py +++ b/mypyc/test/test_run.py @@ -15,7 +15,7 @@ from mypy import build from mypy.errors import CompileError -from mypy.options import TYPE_VAR_TUPLE, UNPACK, Options +from mypy.options import Options from mypy.test.config import test_temp_dir from mypy.test.data import DataDrivenTestCase 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) -> options.preserve_asts = True options.allow_empty_bodies = True options.incremental = self.separate - options.enable_incomplete_feature = [TYPE_VAR_TUPLE, UNPACK] # Avoid checking modules/packages named 'unchecked', to provide a way # to test interacting with code we don't have types for. diff --git a/test-data/unit/pythoneval.test b/test-data/unit/pythoneval.test index c6ca71f5d56a..9f6f5d3838a4 100644 --- a/test-data/unit/pythoneval.test +++ b/test-data/unit/pythoneval.test @@ -2007,7 +2007,7 @@ _testInferenceOfDunderDictOnClassObjects.py:4: error: Property "__dict__" define _testInferenceOfDunderDictOnClassObjects.py:4: error: Incompatible types in assignment (expression has type "Dict[Never, Never]", variable has type "MappingProxyType[str, Any]") [case testTypeVarTuple] -# flags: --enable-incomplete-feature=TypeVarTuple --enable-incomplete-feature=Unpack --python-version=3.11 +# flags: --python-version=3.11 from typing import Any, Callable, Unpack, TypeVarTuple Ts = TypeVarTuple("Ts") @@ -2019,7 +2019,6 @@ def call(callback: Callable[[Unpack[Ts]], Any], *args: Unpack[Ts]) -> Any: ... [case testTypeVarTupleTypingExtensions] -# flags: --enable-incomplete-feature=TypeVarTuple --enable-incomplete-feature=Unpack from typing_extensions import Unpack, TypeVarTuple from typing import Any, Callable