@@ -123,7 +123,7 @@ reveal_type(empty) # N: Revealed type is "__main__.Variadic[()]"
123123omitted: Variadic
124124reveal_type(omitted) # N: Revealed type is "__main__.Variadic[Unpack[builtins.tuple[Any, ...]]]"
125125
126- bad: Variadic[Unpack[Tuple[int, ...]], str, Unpack[Tuple[bool, ...]]] # E: More than one variable Unpack in a type is not allowed
126+ bad: Variadic[Unpack[Tuple[int, ...]], str, Unpack[Tuple[bool, ...]]] # E: More than one variadic Unpack in a type is not allowed
127127reveal_type(bad) # N: Revealed type is "__main__.Variadic[Unpack[builtins.tuple[builtins.int, ...]], builtins.str]"
128128
129129bad2: Unpack[Tuple[int, ...]] # E: Unpack is only valid in a variadic position
@@ -353,12 +353,12 @@ expect_variadic_array_2(u)
353353Ts = TypeVarTuple("Ts")
354354Ts2 = TypeVarTuple("Ts2")
355355
356- def bad(x: Tuple[int, Unpack[Ts], str, Unpack[Ts2]]) -> None: # E: More than one variable Unpack in a type is not allowed
356+ def bad(x: Tuple[int, Unpack[Ts], str, Unpack[Ts2]]) -> None: # E: More than one variadic Unpack in a type is not allowed
357357
358358 ...
359359reveal_type(bad) # N: Revealed type is "def [Ts, Ts2] (x: tuple[builtins.int, Unpack[Ts`-1], builtins.str])"
360360
361- def bad2(x: Tuple[int, Unpack[Tuple[int, ...]], str, Unpack[Tuple[str, ...]]]) -> None: # E: More than one variable Unpack in a type is not allowed
361+ def bad2(x: Tuple[int, Unpack[Tuple[int, ...]], str, Unpack[Tuple[str, ...]]]) -> None: # E: More than one variadic Unpack in a type is not allowed
362362 ...
363363reveal_type(bad2) # N: Revealed type is "def (x: tuple[builtins.int, Unpack[builtins.tuple[builtins.int, ...]], builtins.str])"
364364[builtins fixtures/tuple.pyi]
@@ -571,7 +571,7 @@ from typing_extensions import Unpack, TypeVarTuple
571571
572572Ts = TypeVarTuple("Ts")
573573Us = TypeVarTuple("Us")
574- a: Callable[[Unpack[Ts], Unpack[Us]], int] # E: More than one variable Unpack in a type is not allowed
574+ a: Callable[[Unpack[Ts], Unpack[Us]], int] # E: More than one variadic Unpack in a type is not allowed
575575reveal_type(a) # N: Revealed type is "def [Ts, Us] (*Unpack[Ts`-1]) -> builtins.int"
576576b: Callable[[Unpack], int] # E: Unpack[...] requires exactly one type argument
577577reveal_type(b) # N: Revealed type is "def (*Any) -> builtins.int"
@@ -725,15 +725,15 @@ Ts = TypeVarTuple("Ts")
725725Us = TypeVarTuple("Us")
726726class G(Generic[Unpack[Ts]]): ...
727727
728- A = Tuple[Unpack[Ts], Unpack[Us]] # E: More than one variable Unpack in a type is not allowed
728+ A = Tuple[Unpack[Ts], Unpack[Us]] # E: More than one variadic Unpack in a type is not allowed
729729x: A[int, str]
730730reveal_type(x) # N: Revealed type is "tuple[builtins.int, builtins.str]"
731731
732- B = Callable[[Unpack[Ts], Unpack[Us]], int] # E: More than one variable Unpack in a type is not allowed
732+ B = Callable[[Unpack[Ts], Unpack[Us]], int] # E: More than one variadic Unpack in a type is not allowed
733733y: B[int, str]
734734reveal_type(y) # N: Revealed type is "def (builtins.int, builtins.str) -> builtins.int"
735735
736- C = G[Unpack[Ts], Unpack[Us]] # E: More than one variable Unpack in a type is not allowed
736+ C = G[Unpack[Ts], Unpack[Us]] # E: More than one variadic Unpack in a type is not allowed
737737z: C[int, str]
738738reveal_type(z) # N: Revealed type is "__main__.G[builtins.int, builtins.str]"
739739[builtins fixtures/tuple.pyi]
@@ -2223,12 +2223,12 @@ cb2(1, 2, 3, a="a", b="b")
22232223cb2(1, a="a", b="b") # E: Too few arguments
22242224cb2(1, 2, 3, a="a") # E: Missing named argument "b"
22252225
2226- bad1: Callable[[Unpack[Ints], Unpack[Ints]], None] # E: More than one variable Unpack in a type is not allowed
2226+ bad1: Callable[[Unpack[Ints], Unpack[Ints]], None] # E: More than one variadic Unpack in a type is not allowed
22272227reveal_type(bad1) # N: Revealed type is "def (*builtins.int)"
22282228bad2: Callable[[Unpack[Keywords], Unpack[Keywords]], None] # E: "Keywords" cannot be unpacked (must be tuple or TypeVarTuple)
22292229reveal_type(bad2) # N: Revealed type is "def (*Any, **Unpack[TypedDict('__main__.Keywords', {'a': builtins.str, 'b': builtins.str})])"
22302230bad3: Callable[[Unpack[Keywords], Unpack[Ints]], None] # E: "Keywords" cannot be unpacked (must be tuple or TypeVarTuple) \
2231- # E: More than one variable Unpack in a type is not allowed
2231+ # E: More than one variadic Unpack in a type is not allowed
22322232reveal_type(bad3) # N: Revealed type is "def (*Any)"
22332233[builtins fixtures/dict.pyi]
22342234[typing fixtures/typing-typeddict.pyi]
0 commit comments