diff --git a/stdlib/3.4/asyncio/futures.pyi b/stdlib/3.4/asyncio/futures.pyi index 00086f45a..28dbefb0d 100644 --- a/stdlib/3.4/asyncio/futures.pyi +++ b/stdlib/3.4/asyncio/futures.pyi @@ -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: ...