mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-04 19:28:50 +08:00
Make AbstractEventLoop.run_in_executor return an Awaitable, instead of being a coroutine (#4457)
Closes: #3999
This commit is contained in:
1 parent
61537be530
commit
512c154638
2 files changed
+2
-6
No files matched your search
@@ -68,11 +68,7 @@ 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: ...
|
||||
# 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( # type: ignore
|
||||
self, executor: Any, func: Callable[..., _T], *args: Any,
|
||||
) -> Future[_T]: ...
|
||||
def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any,) -> Future[_T]: ...
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
async def getaddrinfo(
|
||||
|
||||
@@ -116,7 +116,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
@abstractmethod
|
||||
async def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> _T: ...
|
||||
def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Awaitable[_T]: ...
|
||||
@abstractmethod
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
|
||||
Reference in new issue
Block a user