Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document --enable-incomplete-feature possible values in "mypy --help" #16661

Merged
merged 4 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

Expand Down