From 3933b61945ddcbe03460cf1c545e13adf8528383 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 8 Jun 2020 11:28:09 +0200 Subject: [PATCH] Remove BinaryIO.write() write() is inherited from IO[bytes], where it's defined as `def write(self, s: AnyStr) -> int: ...`. If AnyStr is bytes, this should accept bytes, bytearray, and memoryview, so the overload is unnecessary. Closes: #4201 --- stdlib/3/typing.pyi | 7 ------- 1 file changed, 7 deletions(-) diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 33062414191e..7e2151eeeaf5 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -515,13 +515,6 @@ class BinaryIO(IO[bytes]): # TODO readinto # TODO read1? # TODO peek? - @overload - @abstractmethod - def write(self, s: bytearray) -> int: ... - @overload - @abstractmethod - def write(self, s: bytes) -> int: ... - @abstractmethod def __enter__(self) -> BinaryIO: ...