Author nikratio
Recipients nikratio, pitrou, serhiy.storchaka, vstinner
Date 2014-03-25.21:00:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5331EE5E.5050301@rath.org>
In-reply-to <1395779998.71.0.428920336252.issue21057@psf.upfronthosting.co.za>
Content
On 03/25/2014 01:39 PM, Serhiy Storchaka wrote:
> read1() should return bytes. MyByteStream doesn't implement the io.BufferedIOBase interface.

Indeed, this is what this issue is about :-).

The question is: is there a good reason to require io.BufferedIOBase
implementors to return bytes rather than any bytes-like object from read1?

I'd also argue that the current documentation of io.BufferedIOBase
actually does not clearly require read1 to return bytes. The exact
formulation is "Read and return up to *size* bytes" (note that "bytes"
is not interpreted text). This can just as easily read as "return binary
data of up to *size* bytes using one of the customary Python types".

So if it turns out that there is a good reason for this requirement, the
documentation should at least make this requirement more explicit.

Best,
-Nikolaus

-- 
Encrypted emails preferred.
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

             »Time flies like an arrow, fruit flies like a Banana.«
History
Date User Action Args
2014-03-25 21:00:17nikratiosetrecipients: + nikratio, pitrou, vstinner, serhiy.storchaka
2014-03-25 21:00:17nikratiolinkissue21057 messages
2014-03-25 21:00:17nikratiocreate