mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Change run_in_executor to return a Future rather than be a coroutine (#3935)
This commit is contained in:
@@ -72,8 +72,10 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ...) -> Handle: ...
|
||||
else:
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
async def run_in_executor(self, executor: Any,
|
||||
func: Callable[..., _T], *args: Any) -> _T: ...
|
||||
# run_in_executor is defined as a coroutine in AbstractEventLoop but returns a Future in concrete implementation.
|
||||
# Need to ignore mypy Return type error as a result.
|
||||
def run_in_executor(self, executor: Any, # type: ignore
|
||||
func: Callable[..., _T], *args: Any) -> Future[_T]: ...
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
|
||||
|
||||
Reference in New Issue
Block a user