Open
Description
class Shape[*Ts](tuple[*Ts]): ...
class Shape0(Shape[()]): ...
class Shape1(Shape[int]): ...
def rank(shape: tuple[int, ...]) -> int:
return len(shape)
_ = rank(Shape()) # ✅
_ = rank(()) # ✅
_ = rank(Shape0()) # ❌ Argument 1 to "rank" has incompatible type "Shape0"; expected "tuple[int, ...]"
_ = rank(Shape1([1])) # ✅
Perhaps this is related to #19105, which also involves empty tuple subtypes.