Skip to content

Commit ad4e0cb

Browse files
committed
🩹 add missing typevar bound
1 parent 4b793b2 commit ad4e0cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/_numtype/_rank.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class _HasRank(Protocol[_ShapeT_co]):
8585

8686
_FromT_contra = TypeVar("_FromT_contra", default=Any, contravariant=True)
8787
_ToT_contra = TypeVar("_ToT_contra", bound=Shape, default=Any, contravariant=True)
88-
_RankT_co = TypeVar("_RankT_co", default=Any, covariant=True)
88+
_RankT_co = TypeVar("_RankT_co", bound=Shape, default=Any, covariant=True)
8989

9090
@final
9191
@type_check_only
@@ -98,7 +98,7 @@ class _CanBroadcastTo(Protocol[_ToT_contra, _RankT_co]):
9898
def __broadcast_to__(self, to: _ToT_contra, /) -> _RankT_co: ...
9999

100100
# This double shape-type parameter is a sneaky way to annotate a doubly-bound nominal type range,
101-
# e.g. `_HasShape[Shape2ToN, Shape0ToN]` accepts `Shape2ToN`, `Shape1ToN`, and `Shape0ToN`, but
101+
# e.g. `_HasOwnShape[Shape2ToN, Shape0ToN]` accepts `Shape2ToN`, `Shape1ToN`, and `Shape0ToN`, but
102102
# rejects `Shape3ToN` and `Shape1`. Besides brevity, it also works around several mypy bugs that
103103
# are related to "unions vs joins".
104104

0 commit comments

Comments
 (0)