Version-Specific Features

Python 3.15 — TypeForm annotation

Describes values that are valid type expressions representing a type compatible with T, including expressions that are not ordinary class objects. It is intended for APIs consuming type forms, not automatic runtime value validation. Requires Python 3.15 or the relevant build; example is not executed locally.

Formal Syntax & Structure

python syntaxpython
typing.TypeForm[T]

Return Value

Feature-specific

No single return type; see the example and feature description.

Working Example

Example Snippetpython
from typing import TypeFormdef show(form: TypeForm[object]):    print(form)show(list[int])
Python Reference