@@ -230,9 +230,11 @@ For example:
230
230
231
231
callback: Callable[[str], Awaitable[None]] = on_update
232
232
233
+ .. index :: single: ...; ellipsis literal
234
+
233
235
The subscription syntax must always be used with exactly two values: the
234
236
argument list and the return type. The argument list must be a list of types,
235
- a :class: `ParamSpec `, :data: `Concatenate `, or an ellipsis. The return type must
237
+ a :class: `ParamSpec `, :data: `Concatenate `, or an ellipsis (`` ... ``) . The return type must
236
238
be a single type.
237
239
238
240
If a literal ellipsis ``... `` is given as the argument list, it indicates that
@@ -375,8 +377,11 @@ accepts *any number* of type arguments::
375
377
# but ``z`` has been assigned to a tuple of length 3
376
378
z: tuple[int] = (1, 2, 3)
377
379
380
+ .. index :: single: ...; ellipsis literal
381
+
378
382
To denote a tuple which could be of *any * length, and in which all elements are
379
- of the same type ``T ``, use ``tuple[T, ...] ``. To denote an empty tuple, use
383
+ of the same type ``T ``, use the literal ellipsis ``... ``: ``tuple[T, ...] ``.
384
+ To denote an empty tuple, use
380
385
``tuple[()] ``. Using plain ``tuple `` as an annotation is equivalent to using
381
386
``tuple[Any, ...] ``::
382
387
@@ -1154,6 +1159,8 @@ These can be used as types in annotations. They all support subscription using
1154
1159
1155
1160
Special form for annotating higher-order functions.
1156
1161
1162
+ .. index :: single: ...; ellipsis literal
1163
+
1157
1164
``Concatenate `` can be used in conjunction with :ref: `Callable <annotating-callables >` and
1158
1165
:class: `ParamSpec ` to annotate a higher-order callable which adds, removes,
1159
1166
or transforms parameters of another
0 commit comments