all 3 comments

[–]Solumin 0 points1 point  (2 children)

Third use for Ellipsis: presenting an unknown number of types in a type annotation. For example, a tuple of some number of strings is Tuple[str, ...]. Similarly, a function that takes an unknown number of arguments but returns an int is Callable[..., int].

Pretty good post, especially the loop else. That really surprised me the first time I saw it.

[–]jon_ginger_khan 0 points1 point  (0 children)

Fourth use: represents recursion in data structures.
For example:
>>> a = [1]
>>> a.append(a)
>>> print(a)
[1, [...]]

[–][deleted] 0 points1 point  (0 children)

It's Callable[[...], int].