PyDocs

Nav

Development Tools

TypeForm

typing

data · Added in 3.15
A special form representing the value that results from the evaluation
of a type expression.

This value encodes the information supplied in the type expression, and it
represents the type described by that type expression.

When used in a type expression, TypeForm describes a set of type form
objects. It accepts a single type argument, which must be a valid type
expression. ``TypeForm[T]`` describes the set of all type form objects that
represent the type T or types that are assignable to T.

Usage::

    def cast[T](typ: TypeForm[T], value: Any) -> T: ...

    reveal_type(cast(int, "x"))  # int

See PEP 747 for more information.
0 Examples
No examples for typing/TypeForm.
See Also
No see-alsos for typing/TypeForm
0 Notes
No notes for TypeForm