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 51ff533 commit e373264Copy full SHA for e373264
docs/spec/tuples.rst
@@ -31,6 +31,17 @@ compatible with any tuple of any length. This is useful for gradual typing.
31
The type ``tuple`` (with no type arguments provided) is equivalent to
32
``tuple[Any, ...]``.
33
34
+Arbitrary-length tuples have exactly two type arguments -- the type and
35
+an ellipsis. Any other tuple form that uses an ellipsis is invalid::
36
+
37
+ t1: tuple[int, ...] # OK
38
+ t2: tuple[int, int, ...] # Invalid
39
+ t3: tuple[...] # Invalid
40
+ t4: tuple[..., int] # Invalid
41
+ t5: tuple[int, ..., int] # Invalid
42
+ t6: tuple[*tuple[str], ...] # Invalid
43
+ t7: tuple[*tuple[str, ...], ...] # Invalid
44
45
46
Unpacked Tuple Form
47
-------------------
0 commit comments