We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0aaa011 commit 8bb25faCopy full SHA for 8bb25fa
test-data/unit/check-typevar-tuple.test
@@ -2675,9 +2675,21 @@ class A(tuple[Unpack[tuple[int]]]): ...
2675
class B(tuple[Unpack[tuple[()]]]): ...
2676
2677
a: A
2678
-tuple(a)
+reveal_type(tuple(a)) # N: Revealed type is "builtins.tuple[builtins.int, ...]"
2679
(x,) = a
2680
2681
b: B
2682
(_,) = b # E: Need more than 0 values to unpack (1 expected)
2683
[builtins fixtures/tuple.pyi]
2684
+
2685
+[case testNoCrashSubclassingTupleWithVariadicUnpack]
2686
+# https://github.com/python/mypy/issues/19105
2687
+from typing import Unpack
2688
2689
+class A(tuple[Unpack[tuple[int, ...]]]): ...
2690
2691
+a: A
2692
+tuple(a)
2693
+(x,) = a
2694
+(_,) = a
2695
+[builtins fixtures/tuple.pyi]
0 commit comments