Improve asyncio callbacks (#8192)

This commit is contained in:
Alex Waygood
2022-07-19 03:46:38 +01:00
committed by GitHub
parent 9519e3652b
commit 4b504c78e0
8 changed files with 31 additions and 31 deletions

View File

@@ -44,7 +44,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def get_loop(self) -> AbstractEventLoop: ...
@property
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ...
def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: Any | None = ...) -> bool: ...
else:
@@ -54,7 +54,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def done(self) -> bool: ...
def result(self) -> _T: ...
def exception(self) -> BaseException | None: ...
def remove_done_callback(self: Self, __fn: Callable[[Self], Any]) -> int: ...
def remove_done_callback(self: Self, __fn: Callable[[Self], object]) -> int: ...
def set_result(self, __result: _T) -> None: ...
def set_exception(self, __exception: type | BaseException) -> None: ...
def __iter__(self) -> Generator[Any, None, _T]: ...