From 42d8384d63f4bdc09fb21e45304983a002dec8db Mon Sep 17 00:00:00 2001 From: mohsinm-dev Date: Sun, 16 Nov 2025 22:31:57 +0500 Subject: [PATCH 1/3] gh-141627: Fix BufferedRandom inheritance documentation BufferedRandom does not inherit from BufferedReader and BufferedWriter in the C implementation. Update documentation to accurately state that it inherits from BufferedIOBase and provides combined functionality. --- Doc/library/io.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index dfebccb5a9cb91..4c7c9fa48dbefd 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -833,8 +833,9 @@ than raw I/O does. .. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE) A buffered binary stream providing higher-level access to a seekable - :class:`RawIOBase` raw binary stream. It inherits from :class:`BufferedReader` - and :class:`BufferedWriter`. + :class:`RawIOBase` raw binary stream. It inherits from :class:`BufferedIOBase` + and provides the combined functionality of :class:`BufferedReader` and + :class:`BufferedWriter` for random access streams. The constructor creates a reader and writer for a seekable raw stream, given in the first argument. If the *buffer_size* is omitted it defaults to From cde0a7b86ebc10e92b6179febb08e4900092ae96 Mon Sep 17 00:00:00 2001 From: mohsinm-dev Date: Mon, 17 Nov 2025 12:54:28 +0500 Subject: [PATCH 2/3] Remove misleading BufferedRandom inheritance claim --- Doc/library/io.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 4c7c9fa48dbefd..490b10f81719e1 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -833,9 +833,7 @@ than raw I/O does. .. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE) A buffered binary stream providing higher-level access to a seekable - :class:`RawIOBase` raw binary stream. It inherits from :class:`BufferedIOBase` - and provides the combined functionality of :class:`BufferedReader` and - :class:`BufferedWriter` for random access streams. + :class:`RawIOBase` raw binary stream. The constructor creates a reader and writer for a seekable raw stream, given in the first argument. If the *buffer_size* is omitted it defaults to From de9456da58a7ef23a6c8830b5eff0ae86223950f Mon Sep 17 00:00:00 2001 From: mohsinm-dev Date: Wed, 19 Nov 2025 17:57:37 +0500 Subject: [PATCH 3/3] Updated : Doc buffered context --- Doc/library/io.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 490b10f81719e1..74637ad3dd5113 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -832,8 +832,9 @@ than raw I/O does. .. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE) - A buffered binary stream providing higher-level access to a seekable - :class:`RawIOBase` raw binary stream. + A buffered binary stream implementing :class:`BufferedIOBase` interfaces + providing higher-level access to a seekable :class:`RawIOBase` raw binary + stream. The constructor creates a reader and writer for a seekable raw stream, given in the first argument. If the *buffer_size* is omitted it defaults to