mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use self-type in asyncio.Future.*_done_callback (#1614)
This commit is contained in:
committed by
Jelle Zijlstra
parent
b54a711778
commit
8b6234ad2c
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user