Search notes:

PEP 3116 - New I/O

Any object that provides read() or write() is a stream-like object.
This PEP addresses useful ("exotic") functions like readline() or seek() (which may or may not be available in a stream-like object).
The new I/O spec is intended to be similar ot the Java I/O libraries.
There are three I/O layers, each of which as an abstract base class:

Methods and properties

Methods that I/O classes may provide seem to include:
close()
closed
fileno() Only descendants of io.RawIOBase
flush()
isatty()
readable
readline()
readlines()
seek()
seekable
tell()
truncate()
writable
writelines()
In addition, there is also __enter__ and __exit__, __iter__ and __next__, and other dunder functions.

See also

The open function.
socket.makefile
A small list of other interesting PEPs
Some _io types

Links

https://peps.python.org/pep-3116/

Index