classShape[*Ts](tuple[*Ts]): ...
classShape0(Shape[()]): ...
classShape1(Shape[int]): ...
defrank(shape: tuple[int, ...]) ->int:
returnlen(shape)
_=rank(Shape()) # ✅_=rank(()) # ✅_=rank(Shape0()) # ❌ Argument 1 to "rank" has incompatible type "Shape0"; expected "tuple[int, ...]"_=rank(Shape1([1])) # ✅
playground
Perhaps this is related to #19105, which also involves empty tuple subtypes.
playground
Perhaps this is related to #19105, which also involves empty tuple subtypes.