Closed
Labels
3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-IO
Description
Documentation
TextIOBase is a base class .
TextIOBase class should be under the I/O Base Classes section
Linked PRs
- gh-148467: Move
io.TextIOBasedocs to "I/O Base Classes" section #150015 - gh-148467: Move BufferedIOBase close to concrete implementations #150838
- [3.15] gh-148467: Move BufferedIOBase close to concrete implementations (GH-150838) #161917
- [3.14] gh-148467: Move BufferedIOBase close to concrete implementations (GH-150838) #162038
Metadata
Metadata
Assignees
Labels
3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-IO
Projects
- StatusShow more project fieldsTodo
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…
[3.14] gh-148467: Move BufferedIOBase close to concrete implementatio…