|
1 | 1 | import sys
|
2 | 2 | import threading
|
3 | 3 | from _typeshed import Self
|
4 |
| -from abc import abstractmethod |
5 |
| -from collections.abc import Callable, Container, Iterable, Iterator, Sequence |
| 4 | +from collections.abc import Callable, Iterable, Iterator, Sequence |
6 | 5 | from logging import Logger
|
7 | 6 | from types import TracebackType
|
8 |
| -from typing import Any, Generic, Protocol, TypeVar, overload |
| 7 | +from typing import Any, Generic, TypeVar, overload |
9 | 8 | from typing_extensions import Literal, ParamSpec, SupportsIndex
|
10 | 9 |
|
11 | 10 | if sys.version_info >= (3, 9):
|
@@ -33,16 +32,8 @@ if sys.version_info >= (3, 8):
|
33 | 32 | class BrokenExecutor(RuntimeError): ...
|
34 | 33 |
|
35 | 34 | _T = TypeVar("_T")
|
36 |
| -_T_co = TypeVar("_T_co", covariant=True) |
37 | 35 | _P = ParamSpec("_P")
|
38 | 36 |
|
39 |
| -# Copied over Collection implementation as it does not exist in Python 2 and <3.6. |
40 |
| -# Also to solve pytype issues with _Collection. |
41 |
| -class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): |
42 |
| - # Implement Sized (but don't have it as a base class). |
43 |
| - @abstractmethod |
44 |
| - def __len__(self) -> int: ... |
45 |
| - |
46 | 37 | class Future(Generic[_T]):
|
47 | 38 | def __init__(self) -> None: ...
|
48 | 39 | def cancel(self) -> bool: ...
|
|
0 commit comments