Skip to content

Commit 98afaa4

Browse files
authored
Fix loop.remove_reader() and loop.remove_writer() return types (#7042)
1 parent 0151044 commit 98afaa4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stdlib/asyncio/base_events.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
353353
**kwargs: Any,
354354
) -> tuple[SubprocessTransport, _ProtocolT]: ...
355355
def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
356-
def remove_reader(self, fd: FileDescriptorLike) -> None: ...
356+
def remove_reader(self, fd: FileDescriptorLike) -> bool: ...
357357
def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
358-
def remove_writer(self, fd: FileDescriptorLike) -> None: ...
358+
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
359359
# Completion based I/O methods returning Futures prior to 3.7
360360
if sys.version_info >= (3, 7):
361361
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...

stdlib/asyncio/events.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
417417
@abstractmethod
418418
def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
419419
@abstractmethod
420-
def remove_reader(self, fd: FileDescriptorLike) -> None: ...
420+
def remove_reader(self, fd: FileDescriptorLike) -> bool: ...
421421
@abstractmethod
422422
def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ...
423423
@abstractmethod
424-
def remove_writer(self, fd: FileDescriptorLike) -> None: ...
424+
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
425425
# Completion based I/O methods returning Futures prior to 3.7
426426
if sys.version_info >= (3, 7):
427427
@abstractmethod

0 commit comments

Comments
 (0)