File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -484,6 +484,16 @@ Also consider the following example::
484484
485485In this case ``MyDict `` has a single type parameter, ``T ``.
486486
487+ Type parameter ordering
488+ -----------------------
489+
490+ For classes using the Python 3.12 generic class syntax, the type
491+ parameter order is determined by the order of parameters in the type
492+ parameter list::
493+
494+ class NewStyle[T1, T2]:
495+ ...
496+
487497Type variables are applied to the defined class in the order in which
488498they first appear in any generic base classes::
489499
@@ -541,14 +551,7 @@ affect type parameter ordering::
541551 class BareProtoChild(ProtoBase[T1, T2], Protocol):
542552 ...
543553
544- In both examples above, the type parameter order is ``T1 ``, ``T2 ``.
545-
546- For classes using the Python 3.12 generic class syntax, the type
547- parameter order is determined by the order of parameters in the type
548- parameter list::
549-
550- class NewStyle[T1, T2]:
551- ...
554+ In all of the examples above, the type parameter order is ``T1 ``, ``T2 ``.
552555
553556A type checker should report an error when the type variable order is
554557inconsistent::
You can’t perform that action at this time.
0 commit comments