Skip to content

Commit 9d3f6c5

Browse files
committed
Address review
1 parent 555199f commit 9d3f6c5

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Doc/whatsnew/3.15.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,15 @@ typing
477477
or ``TD = TypedDict("TD", {})`` instead.
478478
(Contributed by Bénédikt Tran in :gh:`133823`.)
479479

480+
* Code like ``class ExtraTypeVars(P1[S], Protocol[T, T2]): ...`` now raises
481+
a :exc:`TypeError`, because ``S`` is not listed in ``Protocol`` parameters.
482+
(Contributed by Nikita Sobolev in :gh:`137191`.)
483+
484+
* Code like ``class B2(A[T2], Protocol[T1, T2]): ...`` now correctly handles
485+
type parameters order: it is ``(T1, T2)``, not ``(T2, T1)``
486+
as it was incorrectly infered in runtime before.
487+
(Contributed by Nikita Sobolev in :gh:`137191`.)
488+
480489

481490
wave
482491
----

Lib/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def _collect_type_parameters(
265265
"""Collect all type parameters in args
266266
in order of first appearance (lexicographic order).
267267
268-
Having an explicit `Generic` or `Protocol` base class determins
268+
Having an explicit `Generic` or `Protocol` base class determines
269269
the exact parameter order.
270270
271271
For example::

0 commit comments

Comments
 (0)