Nikolaus Rath added the comment:

On Feb 27 2015, Martin Panter <rep...@bugs.python.org> wrote:
> In the code review, Nikolaus raised the idea of allowing a custom
> “buffer_size” parameter for the BufferedReader. I think this would
> need a bit of consideration about how it should work:
>
> 1. Should it be a direct wrapper around
> BufferedReader(buffer_size=...)?

I'm not 100% sure what you mean by that, but I think the answer is Yes.

> 2. Should it also support an unbuffered reader mode like
> open(buffering=0), socket.makefile(buffering=0), and
> subprocess.Popen(bufsize=0)?

Yes, in that case the DecompressReader should simply be used without
encapsulating it in BufferedReader.

> 3. Should there be any consideration for buffering in write mode
> (mirroring the equivalent open(), etc parameters)?

I don't think so. There's not much to be gained by buffering data before
passing it to the compressor, so the only point of buffering is to avoid
short writes (or reads in case of decompressing). But the low-level
compressor code already avoids short writes.

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

----------

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

Reply via email to