From aa6f4a07c1952c340cd75ee36988a929f1b06e71 Mon Sep 17 00:00:00 2001 From: Simon Ekstrand Date: Sat, 17 Dec 2016 00:15:20 +0100 Subject: [PATCH] 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. --- stdlib/3.4/asyncio/events.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/3.4/asyncio/events.pyi b/stdlib/3.4/asyncio/events.pyi index 262758fbd..a7d9c4d28 100644 --- a/stdlib/3.4/asyncio/events.pyi +++ b/stdlib/3.4/asyncio/events.pyi @@ -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]: ...