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 — Make `TypeForm` (PEP 747) no longer experimental by Viicos · Pull Request #20946 · python/mypy

Make TypeForm (PEP 747) no longer experimental #20946

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

Closed
Viicos wants to merge 2 commits into python:master from Viicos:typeform-no-exp

Uh oh!

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

Closed

Make TypeForm (PEP 747) no longer experimental #20946

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
ddc3eb3
Make `TypeForm` (PEP 747) no longer experimental
Viicos Mar 2, 2026
55bb171
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 2, 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
Make TypeForm (PEP 747) no longer experimental
  • Loading branch information

Uh oh!

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

@Viicos
Viicos committed Mar 2, 2026
commit ddc3eb36e9ff02841d3cc39ae78f8d78b84ed49b

There are no files selected for viewing

5 changes: 1 addition & 4 deletions 5 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,9 +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 @@ -92,8 +92,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
6 changes: 2 additions & 4 deletions 6 mypy/semanal.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3680,8 +3680,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 @@ -5419,8 +5418,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
6 changes: 0 additions & 6 deletions 6 mypy/typeanal.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -679,12 +679,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 @@ -326,7 +326,7 @@ def call() -> str: pass
[builtins fixtures/module.pyi]

[case testInvalidEscapeSequenceWarningsSuppressed]
# flags: --python-version 3.14 --enable-incomplete-feature=TypeForm
# flags: --python-version 3.14
# 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.