GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TypeForm: Enable by default by davidfstr · Pull Request #21262 · python/mypy

TypeForm: Enable by default #21262

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.

Sign up for GitHub

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

Merged
JukkaL merged 3 commits into python:master from davidfstr:f/typeform_complete
May 1, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

TypeForm: Enable by default #21262

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
7684b86
TypeForm: Enable by default
davidfstr Apr 17, 2026
2d3e4c3
check-typeform.test: Remove --python-version 3.15
davidfstr Apr 29, 2026
53a810b
check-typeform.test: Fix import error
davidfstr Apr 29, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Next Next commit
TypeForm: Enable by default
...removing the need to use --enable-incomplete-feature=TypeForm
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@davidfstr
davidfstr committed Apr 17, 2026
commit 7684b86b79c5e37e5ed32895fef828fa6d879e78

There are no files selected for viewing

4 changes: 1 addition & 3 deletions 4 docs/source/command_line.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ format into the specified directory.
Enabling incomplete/experimental features
*****************************************

.. option:: --enable-incomplete-feature {PreciseTupleTypes,InlineTypedDict,TypeForm}
.. option:: --enable-incomplete-feature {PreciseTupleTypes,InlineTypedDict}

Some features may require several mypy releases to implement, for example
due to their complexity, potential for backwards incompatibility, or
Expand Down Expand Up @@ -1229,8 +1229,6 @@ List of currently incomplete/experimental features:
def test_values() -> {"width": int, "description": str}:
return {"width": 42, "description": "test"}

* ``TypeForm``: this feature enables ``TypeForm``, as described in
`PEP 747 – Annotating Type Forms <https://peps.python.org/pep-0747/>_`.


Miscellaneous
Expand Down
4 changes: 2 additions & 2 deletions 4 mypy/options.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class BuildType:
NEW_GENERIC_SYNTAX: Final = "NewGenericSyntax"
INLINE_TYPEDDICT: Final = "InlineTypedDict"
TYPE_FORM: Final = "TypeForm"
INCOMPLETE_FEATURES: Final = frozenset((PRECISE_TUPLE_TYPES, INLINE_TYPEDDICT, TYPE_FORM))
COMPLETE_FEATURES: Final = frozenset((TYPE_VAR_TUPLE, UNPACK, NEW_GENERIC_SYNTAX))
INCOMPLETE_FEATURES: Final = frozenset((PRECISE_TUPLE_TYPES, INLINE_TYPEDDICT))
COMPLETE_FEATURES: Final = frozenset((TYPE_VAR_TUPLE, UNPACK, NEW_GENERIC_SYNTAX, TYPE_FORM))


class Options:
Expand Down
12 changes: 4 additions & 8 deletions 12 mypy/semanal.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
type_aliases_source_versions,
typing_extensions_aliases,
)
from mypy.options import TYPE_FORM, Options
from mypy.options import Options
from mypy.patterns import (
AsPattern,
ClassPattern,
Expand Down Expand Up @@ -3701,8 +3701,7 @@ def analyze_lvalues(self, s: AssignmentStmt) -> None:
)

def analyze_rvalue_as_type_form(self, s: AssignmentStmt) -> None:
if TYPE_FORM in self.options.enable_incomplete_feature:
self.try_parse_as_type_expression(s.rvalue)
self.try_parse_as_type_expression(s.rvalue)

def apply_dynamic_class_hook(self, s: AssignmentStmt) -> None:
if not isinstance(s.rvalue, CallExpr):
Expand Down Expand Up @@ -5452,8 +5451,7 @@ def visit_return_stmt(self, s: ReturnStmt) -> None:
self.fail('"return" not allowed in except* block', s, serious=True)
if s.expr:
s.expr.accept(self)
if TYPE_FORM in self.options.enable_incomplete_feature:
self.try_parse_as_type_expression(s.expr)
self.try_parse_as_type_expression(s.expr)
self.statement = old

def visit_raise_stmt(self, s: RaiseStmt) -> None:
Expand Down Expand Up @@ -6056,11 +6054,9 @@ def visit_call_expr(self, expr: CallExpr) -> None:
expr.analyzed.accept(self)
else:
# Normal call expression.
calculate_type_forms = TYPE_FORM in self.options.enable_incomplete_feature
for a in expr.args:
a.accept(self)
if calculate_type_forms:
self.try_parse_as_type_expression(a)
self.try_parse_as_type_expression(a)

if (
isinstance(expr.callee, MemberExpr)
Expand Down
8 changes: 1 addition & 7 deletions 8 mypy/typeanal.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
check_arg_kinds,
check_param_names,
)
from mypy.options import INLINE_TYPEDDICT, TYPE_FORM, Options
from mypy.options import INLINE_TYPEDDICT, Options
from mypy.plugin import AnalyzeTypeContext, Plugin, TypeAnalyzerPluginInterface
from mypy.semanal_shared import (
SemanticAnalyzerCoreInterface,
Expand Down Expand Up @@ -674,12 +674,6 @@ def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Typ
item = AnyType(TypeOfAny.from_error)
return TypeType.make_normalized(item, line=t.line, column=t.column)
elif fullname in ("typing_extensions.TypeForm", "typing.TypeForm"):
if TYPE_FORM not in self.options.enable_incomplete_feature:
self.fail(
"TypeForm is experimental,"
" must be enabled with --enable-incomplete-feature=TypeForm",
t,
)
if len(t.args) == 0:
any_type = self.get_omitted_any(t)
return TypeType(any_type, line=t.line, column=t.column, is_type_form=True)
Expand Down
2 changes: 1 addition & 1 deletion 2 test-data/unit/check-fastparse.test
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def call() -> str: pass
[builtins fixtures/module.pyi]

[case testInvalidEscapeSequenceWarningsSuppressed]
# flags: --python-version 3.14 --enable-incomplete-feature=TypeForm
# flags: --python-version 3.15
# Test that SyntaxWarnings for invalid escape sequences are suppressed
# when parsing potential type expressions containing regex patterns or
# similar strings. Callable arguments are always potential type expressions.
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.