mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Fix AbstractEventLoop.call* callable definitions. (#753)
Several asyncio AbstractEventLoop methods take a callback as an argument that is passed *args. The Callable definition was incorrect for those callbacks.
This commit is contained in:
committed by
Guido van Rossum
parent
830c2fb089
commit
aa6f4a07c1
@@ -16,7 +16,7 @@ class Handle:
|
||||
__slots__ = ... # type: List[str]
|
||||
_cancelled = False
|
||||
_args = ... # type: List[Any]
|
||||
def __init__(self, callback: Callable[[],Any], args: List[Any],
|
||||
def __init__(self, callback: Callable[..., Any], args: List[Any],
|
||||
loop: AbstractEventLoop) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def cancel(self) -> None: ...
|
||||
@@ -47,16 +47,16 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
def close(self) -> None: ...
|
||||
# Methods scheduling callbacks. All these return Handles.
|
||||
@abstractmethod
|
||||
def call_soon(self, callback: Callable[[],Any], *args: Any) -> Handle: ...
|
||||
def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
@abstractmethod
|
||||
def call_later(self, delay: Union[int, float], callback: Callable[[],Any], *args: Any) -> Handle: ...
|
||||
def call_later(self, delay: Union[int, float], callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
@abstractmethod
|
||||
def call_at(self, when: float, callback: Callable[[],Any], *args: Any) -> Handle: ...
|
||||
def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
@abstractmethod
|
||||
def time(self) -> float: ...
|
||||
# Methods for interacting with threads
|
||||
@abstractmethod
|
||||
def call_soon_threadsafe(self, callback: Callable[[],Any], *args: Any) -> Handle: ...
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
@abstractmethod
|
||||
def run_in_executor(self, executor: Any,
|
||||
callback: Callable[[],Any], *args: Any) -> Future[Any]: ...
|
||||
|
||||
Reference in New Issue
Block a user