class io.BufferedReader(raw, buff er_size=DEFAULT_BUFFER_SIZE )
A buffered binary stream providing higher-level access to a readable, non seekable RawIOBase raw binary stream.
Below I create an instance by passing a seekable raw stream without problem?
They could be improved, but I think the point of the docs, is that passing a non-seekable stream to an io.BufferedRandom will error (in use, if not on object creation - I’ve not tested this).
What BufferedReader does with seekables is much of a muchness. But if a BufferedReader can’t assume the underlying base stream has .seek and .tell methods, it won’t be as efficient as a BufferedRandom on a seekable.
BufferedReader.seekable attribute just returns raw.seekable. The docs I think are trying to differentiate that BufferedWriter and BufferedRandom require “seekable” (seek and tell should work on the fd) while BufferedReader does not. Definitely welcome a patch to make that clearer
re: Efficiency shouldn’t actually be effected in this case. Read-only I/O is a lot simpler to buffer than write or read-write.