Skip to content

Reword inheritance diagram for BufferedRandom to encompass _io and _pyio implementations #141627

@tbrugere

Description

@tbrugere

Documentation

The documentation for io.BufferedRandom states

A buffered binary stream providing higher-level access to a seekable RawIOBase raw binary stream. It inherits from BufferedReader and BufferedWriter.

(emphasis mine)

Except when runing cpython,

Python 3.14.0rc3 (main, Sep 18 2025, 19:47:22) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from io import BufferedRandom, BufferedReader
>>> issubclass(BufferedRandom, BufferedReader)
False
>>> BufferedRandom.mro()
[<class '_io.BufferedRandom'>, <class '_io._BufferedIOBase'>, <class '_io._IOBase'>, <class 'object'>]

It seems that BufferedRandom does not inherit from either BufferedReader or BufferedWriter

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtopic-IO

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions