Repository: python/mypy

Issue:
Missing list of incomplete features
**Documentation**

Within the CLI we have the command line switch `--enable-incomplete-feature` which expects a feature name to enable.
Until now I have not been able to find a list of possible (incomplete/under development) features, which I could enable over here.

Have I missed something?



Discussion:
It's defined here, but you're right that it's not documented anywhere:

https://github.com/python/mypy/blob/83660d0ad72ab5a61cea5fe5955e66c33ef54111/mypy/options.py#L70-L73
So, we have to go through the codebase to identify all of the features that can be enabled with the --enable-incomplete-feature switch if I am not wrong?
I also noticed that the `enable_incomplete_feature` settings key is not documented. But if I add `enable_incomplete_feature = ["Unpack"]` to my pyproject.toml, it seems to work as expected.

I think this is somewhat intentional; incomplete features are experimental and incomplete and may be broken in some way, so we don't want to advertise them too much.

However, it should be fine to add a list to the documentation with a note that these features are experimental, we don't guarantee any form of backward compatibility, use at your own risk, etc.
> However, it should be fine to add a list to the documentation with a note that these features are experimental, we don't guarantee any form of backward compatibility, use at your own risk, etc.

I think the latter is a great idea. I'll add a `TODO` to look into this when I find the time otherwise feel free to pick up this issue and resolve it.

Resolving patch:
diff --git a/mypy/main.py b/mypy/main.py
--- 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(


Test patch:
diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py
--- 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
--- 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