Skip to content

Commit 810aceb

Browse files
committed
PEP 747: More precise discussion of subtyping
1 parent a0d84ce commit 810aceb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

peps/pep-0747.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,15 @@ Assignability
311311
t1: TypeForm[int | str] = get_type_form() # OK
312312
t2: TypeForm[str] = get_type_form() # Error
313313

314-
``type[T]`` is a subtype of ``TypeForm[T]``, which means that ``type[B]`` is
315-
assignable to ``TypeForm[A]`` if ``B`` is assignable to ``A``::
314+
Given two fully static types ``T1`` and ``T2``, ``type[T1]`` is a subtype of ``TypeForm[T2]``
315+
if ``T1`` is a subtype of ``T2``::
316316

317317
def get_type() -> type[int]: ...
318318

319319
t3: TypeForm[int | str] = get_type() # OK
320320
t4: TypeForm[str] = get_type() # Error
321321

322-
``TypeForm`` is a subtype of ``object`` and is assumed to have all of the
322+
Any specialization of ``TypeForm`` is a subtype of ``object`` and is assumed to have all of the
323323
attributes and methods of ``object``.
324324

325325

0 commit comments

Comments
 (0)