2 from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable
\r
3 from .events import AbstractEventLoop
\r
4 from concurrent.futures import (
\r
5 CancelledError as CancelledError,
\r
6 TimeoutError as TimeoutError,
\r
7 Future as _ConcurrentFuture,
\r
14 _S = TypeVar('_S', bound=Future)
\r
16 class InvalidStateError(Error): ...
\r
18 class _TracebackLogger:
\r
19 exc = ... # type: BaseException
\r
20 tb = ... # type: List[str]
\r
21 def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
\r
22 def activate(self) -> None: ...
\r
23 def clear(self) -> None: ...
\r
24 def __del__(self) -> None: ...
\r
26 if sys.version_info >= (3, 5):
\r
27 def isfuture(obj: object) -> bool: ...
\r
29 class Future(Awaitable[_T], Iterable[_T]):
\r
30 _state = ... # type: str
\r
31 _exception = ... # type: BaseException
\r
33 _log_traceback = False
\r
34 _tb_logger = ... # type: Type[_TracebackLogger]
\r
35 def __init__(self, *, loop: AbstractEventLoop = ...) -> None: ...
\r
36 def __repr__(self) -> str: ...
\r
37 def __del__(self) -> None: ...
\r
38 def cancel(self) -> bool: ...
\r
39 def _schedule_callbacks(self) -> None: ...
\r
40 def cancelled(self) -> bool: ...
\r
41 def done(self) -> bool: ...
\r
42 def result(self) -> _T: ...
\r
43 def exception(self) -> BaseException: ...
\r
44 def add_done_callback(self: _S, fn: Callable[[_S], Any]) -> None: ...
\r
45 def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ...
\r
46 def set_result(self, result: _T) -> None: ...
\r
47 def set_exception(self, exception: Union[type, BaseException]) -> None: ...
\r
48 def _copy_state(self, other: Any) -> None: ...
\r
49 def __iter__(self) -> Generator[Any, None, _T]: ...
\r
50 def __await__(self) -> Generator[Any, None, _T]: ...
\r
52 def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]]) -> Future[_T]: ...
\r