Use self-type in asyncio.Future.*_done_callback (#1614)

This commit is contained in:
FichteFoll
2017-10-10 19:06:57 +02:00
committed by Jelle Zijlstra
parent b54a711778
commit 8b6234ad2c

View File

@@ -11,6 +11,7 @@ from concurrent.futures import (
__all__: List[str]
_T = TypeVar('_T')
_S = TypeVar('_S', bound=Future)
class InvalidStateError(Error): ...
@@ -40,8 +41,8 @@ class Future(Iterable[_T], Awaitable[_T], Generic[_T]):
def done(self) -> bool: ...
def result(self) -> _T: ...
def exception(self) -> BaseException: ...
def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ...
def remove_done_callback(self, fn: Callable[[Future[_T]], Any]) -> int: ...
def add_done_callback(self: _S, fn: Callable[[_S], Any]) -> None: ...
def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ...
def set_result(self, result: _T) -> None: ...
def set_exception(self, exception: Union[type, BaseException]) -> None: ...
def _copy_state(self, other: Any) -> None: ...