You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reorganize the I/O Base classes documentation #148467
changed the title [-][TextIOBase class](https://github.com/python/cpython/blob/main/Doc/library/io.rst#text-io-1) should be under the [I/O Base Classes](https://github.com/python/cpython/blob/main/Doc/library/io.rst#io-base-classes) section[/-][+]TextIOBase class should be under the I/O Base Classes section[/+]on Apr 12, 2026
Creating a PR request is trivial, but deciding what it should do is not. We should first ask the author of the original documentation, @birkenfeld. Moving TextIOBase to the I/O Base Classes section will move it too far from TextIOWrapper.
BufferedIOBase was initially in the Buffered Streams section. It was moved to the I/O Base Classes by @benjaminp in b6c7beb. But TextIOBase was left in its original place.
What is your opinion, @birkenfeld and @benjaminp? Should we move TextIOBase to "I/O Base Classes" or move BufferedIOBase back to "Buffered Streams"? Or leave it as is, in inconsistent state?
I'd lean moving the *IOBase to the particular I/O section. The *IOBase defines the .read() and .write() guarantees / API shape that is then implemented by specific final classes. In this particular case what StringIO and TextIOWrapper should do for read and write, very common APIs, is defined in TextIOBase so having those close together makes for easy understanding.
The I/O Base classes all being in one section together makes it easier to compare across them. Each layer has some distinct specific API guarantees such as RawIO doesn't retry while BufferedIO does. That is useful to see side by side for an implementer but I don't think most the readers of the documentation are implementing all the I/O clases; they just want to read and write some data.
changed the title [-]TextIOBase class should be under the I/O Base Classes section[/-][+]Reorganize the I/O Base classes documentation[/+]on Jun 3, 2026
Activity
[-][TextIOBase class](https://github.com/python/cpython/blob/main/Doc/library/io.rst#text-io-1) should be under the [I/O Base Classes](https://github.com/python/cpython/blob/main/Doc/library/io.rst#io-base-classes) section[/-][+]TextIOBase class should be under the I/O Base Classes section[/+]picnixz commentedon Apr 12, 2026
It took me a while to understand what you meant but I now I see:
In Text I/O, we have
class io.TextIOBaseandclass io.TextIOWrapper, but indeedio.TextIOBaseshould be moved to the I/O base section.serhiy-storchaka commentedon Apr 13, 2026
cc @pitrou
dagangtj commentedon Apr 13, 2026
I'd like to work on this. I'll submit a PR to move the TextIOBase class documentation under the I/O Base Classes section.
dagangtj commentedon Apr 13, 2026
serhiy-storchaka commentedon Apr 13, 2026
Creating a PR request is trivial, but deciding what it should do is not. We should first ask the author of the original documentation, @birkenfeld. Moving TextIOBase to the I/O Base Classes section will move it too far from TextIOWrapper.
BufferedIOBase was initially in the Buffered Streams section. It was moved to the I/O Base Classes by @benjaminp in b6c7beb. But TextIOBase was left in its original place.
birkenfeld commentedon Apr 13, 2026
I don't think I can remember anything about this anymore :)
serhiy-storchaka commentedon Apr 14, 2026
What is your opinion, @birkenfeld and @benjaminp? Should we move TextIOBase to "I/O Base Classes" or move BufferedIOBase back to "Buffered Streams"? Or leave it as is, in inconsistent state?
habib-source commentedon Apr 14, 2026
If you move BufferedIOBase back to "Buffered Streams". I think RawIOBase would have to move to "Raw File I/O"
cmaloney commentedon Apr 21, 2026
I'd lean moving the
*IOBaseto the particular I/O section. The*IOBasedefines the.read()and.write()guarantees / API shape that is then implemented by specific final classes. In this particular case whatStringIOandTextIOWrappershould do forreadandwrite, very common APIs, is defined inTextIOBaseso having those close together makes for easy understanding.The I/O Base classes all being in one section together makes it easier to compare across them. Each layer has some distinct specific API guarantees such as RawIO doesn't retry while BufferedIO does. That is useful to see side by side for an implementer but I don't think most the readers of the documentation are implementing all the I/O clases; they just want to read and write some data.
[-]TextIOBase class should be under the I/O Base Classes section[/-][+]Reorganize the I/O Base classes documentation[/+]gh-148467: Move BufferedIOBase close to concrete implementations (#15…
[3.15] gh-148467: Move BufferedIOBase close to concrete implementatio…