mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
stdlib: audit more callback annotations (#8209)
This commit is contained in:
@@ -49,7 +49,7 @@ class Future(Generic[_T]):
|
||||
def cancelled(self) -> bool: ...
|
||||
def running(self) -> bool: ...
|
||||
def done(self) -> bool: ...
|
||||
def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ...
|
||||
def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ...
|
||||
def result(self, timeout: float | None = ...) -> _T: ...
|
||||
def set_running_or_notify_cancel(self) -> bool: ...
|
||||
def set_result(self, result: _T) -> None: ...
|
||||
|
||||
@@ -10,6 +10,8 @@ from weakref import ref
|
||||
|
||||
from ._base import BrokenExecutor, Executor, Future
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
_threads_wakeups: MutableMapping[Any, Any]
|
||||
_global_shutdown: bool
|
||||
|
||||
@@ -40,14 +42,12 @@ class _ExceptionWithTraceback:
|
||||
|
||||
def _rebuild_exc(exc: Exception, tb: str) -> Exception: ...
|
||||
|
||||
_S = TypeVar("_S")
|
||||
|
||||
class _WorkItem(Generic[_S]):
|
||||
future: Future[_S]
|
||||
fn: Callable[..., _S]
|
||||
class _WorkItem(Generic[_T]):
|
||||
future: Future[_T]
|
||||
fn: Callable[..., _T]
|
||||
args: Iterable[Any]
|
||||
kwargs: Mapping[str, Any]
|
||||
def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
def __init__(self, future: Future[_T], fn: Callable[..., _T], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
|
||||
class _ResultItem:
|
||||
work_id: int
|
||||
@@ -90,7 +90,7 @@ class _SafeQueue(Queue[Future[Any]]):
|
||||
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
|
||||
|
||||
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ...
|
||||
def _process_chunk(fn: Callable[..., Any], chunk: tuple[Any, None, None]) -> Generator[Any, None, None]: ...
|
||||
def _process_chunk(fn: Callable[..., _T], chunk: Iterable[tuple[Any, ...]]) -> list[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def _sendback_result(
|
||||
|
||||
Reference in New Issue
Block a user