From 0db78259a2f53d672f8b079ce133c48035c721b7 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 15 Sep 2024 08:13:50 -0700 Subject: [PATCH] Incorporated PR feedback. --- peps/pep-0747.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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