This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients benjamin.peterson, martin.panter, njs, stutzbach
Date 2018-01-16.05:09:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516079389.64.0.467229070634.issue32561@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-01-16 05:09:49martin.pantersetrecipients: + martin.panter, benjamin.peterson, stutzbach, njs
2018-01-16 05:09:49martin.pantersetmessageid: <1516079389.64.0.467229070634.issue32561@psf.upfronthosting.co.za>
2018-01-16 05:09:49martin.panterlinkissue32561 messages
2018-01-16 05:09:49martin.pantercreate