diff --git a/peps/pep-0747.rst b/peps/pep-0747.rst index 65c2d3b6654..dd3a053ae69 100644 --- a/peps/pep-0747.rst +++ b/peps/pep-0747.rst @@ -223,7 +223,13 @@ For example, if a static type checker encounters the expression ``str | None``, it may normally evaluate its type as ``UnionType`` because it produces a runtime value that is an instance of ``types.UnionType``. However, because this expression is a valid type expression, it is also assignable to the -type ``TypeForm[str | None]``. +type ``TypeForm[str | None]``: + + v1_actual: UnionType = str | None # OK + v1_type_form: TypeForm[str | None] = str | None # OK + + v2_actual: type = list[int] # OK + v2_type_form: TypeForm = list[int] # OK The ``Annotated`` special form is allowed in type expressions, so it can also appear in an expression that is assignable to ``TypeForm``. Consistent