From 7a3bfcc9662382c0fb6c2019ebbade2fd678fa87 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 26 Jan 2022 13:59:49 +0200 Subject: [PATCH 1/2] Fix loop.remove_reader() and loop.remove_writer() signatures --- stdlib/asyncio/base_events.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index f67fad6f54eb..bcc5a15d9e4d 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -353,9 +353,9 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... - def remove_reader(self, fd: FileDescriptorLike) -> None: ... + def remove_reader(self, fd: FileDescriptorLike) -> bool: ... def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... - def remove_writer(self, fd: FileDescriptorLike) -> None: ... + def remove_writer(self, fd: FileDescriptorLike) -> bool: ... # Completion based I/O methods returning Futures prior to 3.7 if sys.version_info >= (3, 7): async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... From 4d196fe3e2ca21de26bf074a443938021fea09a2 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 26 Jan 2022 15:20:04 +0200 Subject: [PATCH 2/2] Update AbstractEventLoop also --- stdlib/asyncio/events.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index fc8e14edcd9d..89861a8158c5 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -417,11 +417,11 @@ class AbstractEventLoop(metaclass=ABCMeta): @abstractmethod def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... @abstractmethod - def remove_reader(self, fd: FileDescriptorLike) -> None: ... + def remove_reader(self, fd: FileDescriptorLike) -> bool: ... @abstractmethod def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... @abstractmethod - def remove_writer(self, fd: FileDescriptorLike) -> None: ... + def remove_writer(self, fd: FileDescriptorLike) -> bool: ... # Completion based I/O methods returning Futures prior to 3.7 if sys.version_info >= (3, 7): @abstractmethod