@@ -183,7 +183,7 @@ expression, and it represents the type described by that type expression.
183183
184184``TypeForm `` is a special form that, when used in a type expression, describes
185185a set of type form objects. It accepts a single type argument, which must be a
186- valid type expression. ``TypeForm[T] `` describes the set of all type form
186+ :ref: ` valid type expression < valid-type-expressions >` . ``TypeForm[T] `` describes the set of all type form
187187objects that represent the type ``T `` or types that are
188188:term: `assignable to <typing:assignable> ` ``T ``. For example,
189189``TypeForm[str | None] `` describes the set of all type form objects
@@ -218,9 +218,7 @@ equivalent to ``TypeForm[Any]``.
218218Implicit ``TypeForm `` Evaluation
219219--------------------------------
220220
221- When a static type checker encounters an expression that follows all of the
222- syntactic, semantic and contextual rules for a type expression as detailed
223- in the typing spec, the evaluated type of this expression should be assignable
221+ When a static type checker encounters a valid type expression, the evaluated type of this expression should be assignable
224222to ``TypeForm[T] `` if the type it describes is assignable to ``T ``.
225223
226224For example, if a static type checker encounters the expression ``str | None ``,
@@ -248,6 +246,11 @@ be assignable to ``TypeForm``::
248246
249247 v5: TypeForm[set[str]] = "set[str]" # OK
250248
249+ .. _valid-type-expressions :
250+
251+ Valid Type Expressions
252+ ----------------------
253+
251254The typing spec defines syntactic rules for type expressions in the form of a
252255:ref: `formal grammar <typing:expression-grammar >`. Semantic rules are specified
253256as comments along with the grammar definition. Contextual requirements are detailed
@@ -256,8 +259,11 @@ type expressions. For example, the special form ``Self`` can be used in a
256259type expression only within a class, and a type variable can be used within
257260a type expression only when it is associated with a valid scope.
258261
259- Expressions that violate one or more of the syntactic, semantic, or contextual
260- rules for type expressions should not evaluate to a ``TypeForm `` type.::
262+ A valid type expression is an expression that follows all of the syntactic,
263+ semantic, and contextual rules for a type expression.
264+
265+ Expressions that are not valid type expressions should not evaluate to a
266+ ``TypeForm `` type::
261267
262268 bad1: TypeForm = tuple() # Error: Call expression not allowed in type expression
263269 bad2: TypeForm = (1, 2) # Error: Tuple expression not allowed in type expression
0 commit comments