massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / third_party / 2 / concurrent / futures / _base.pyi
1 from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, NamedTuple\r
2 from types import TracebackType\r
3 import sys\r
4 \r
5 FIRST_COMPLETED = ...  # type: str\r
6 FIRST_EXCEPTION = ...  # type: str\r
7 ALL_COMPLETED = ...  # type: str\r
8 PENDING = ...  # type: Any\r
9 RUNNING = ...  # type: Any\r
10 CANCELLED = ...  # type: Any\r
11 CANCELLED_AND_NOTIFIED = ...  # type: Any\r
12 FINISHED = ...  # type: Any\r
13 LOGGER = ...  # type: Any\r
14 \r
15 class Error(Exception): ...\r
16 class CancelledError(Error): ...\r
17 class TimeoutError(Error): ...\r
18 \r
19 _T = TypeVar('_T')\r
20 \r
21 class Future(Generic[_T]):\r
22     def __init__(self) -> None: ...\r
23     def cancel(self) -> bool: ...\r
24     def cancelled(self) -> bool: ...\r
25     def running(self) -> bool: ...\r
26     def done(self) -> bool: ...\r
27     def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ...\r
28     def result(self, timeout: Optional[float] = ...) -> _T: ...\r
29     def set_running_or_notify_cancel(self) -> bool: ...\r
30     def set_result(self, result: _T) -> None: ...\r
31 \r
32     if sys.version_info >= (3,):\r
33         def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ...\r
34         def set_exception(self, exception: Optional[BaseException]) -> None: ...\r
35     else:\r
36         def exception(self, timeout: Optional[float] = ...) -> Any: ...\r
37         def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ...\r
38         def set_exception(self, exception: Any) -> None: ...\r
39         def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...\r
40 \r
41 \r
42 class Executor:\r
43     def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...\r
44     if sys.version_info >= (3, 5):\r
45         def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...) -> Iterator[_T]: ...\r
46     else:\r
47         def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ...\r
48     def shutdown(self, wait: bool = ...) -> None: ...\r
49     def __enter__(self: _T) -> _T: ...\r
50     def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool: ...\r
51 \r
52 def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...\r
53 \r
54 def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...\r