Martin Panter <vadmium...@gmail.com> added the comment:

BufferedIOBase is an abstract class and, despite the name, doesn’t necessitate 
a buffer or cache. Adding methods and properties might break compatibility with 
third-party implementations, or get ugly with optional methods and multiple 
versions of the API. It seems like it would be better to extend the concrete 
APIs: io.BufferedReader, BufferedWriter and/or FileIO.

In Issue 32475 there is a proposal to add a “getbuffn” method returning the 
amount of unread pending data in a reader object. Perhaps that would be enough 
for reading.

I would support an similar API for BufferedWriter etc. Perhaps a property 
called “available_space”. You could check that and decide whether to do a 
direct non-blocking “write”, or launch a blocking “write” in the background.

----------
nosy: +martin.panter

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32561>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to