From d45ec1a0e2bc9e13236cff338e2750b9ea2bdcb9 Mon Sep 17 00:00:00 2001 From: donbarbos Date: Thu, 15 Jan 2026 14:00:28 +0400 Subject: [PATCH] [ssl] Deprecate read and write methods Docs: https://docs.python.org/dev/library/ssl.html#ssl.SSLSocket.read --- stdlib/ssl.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 32921b4f0961..2053005f1ba6 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -291,7 +291,9 @@ class SSLSocket(socket.socket): @overload def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... def shutdown(self, how: int) -> None: ... + @deprecated("Deprecated since Python 3.6. Use `SSLSocket.recv` method instead.") def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... + @deprecated("Deprecated since Python 3.6. Use `SSLSocket.send` method instead.") def write(self, data: ReadableBuffer) -> int: ... def do_handshake(self, block: bool = False) -> None: ... # block is undocumented @overload