[Python-3000] Draft PEP for New IO system

Daniel Stutzbach daniel.stutzbach at gmail.com
Sun Mar 4 22:42:21 CET 2007


On 3/1/07, Mike Verdone <mike.verdone at gmail.com> wrote:
> When write is called check if the buffer is bigger than buffer_size.
> If it is attempt to pre-flush the buffer. If we can't pre-flush, raise
> BlockingIO error.

I'd much rather see dynamically-sized buffers.  If it works as you
describe, then any application that wants to use reliable [1]
non-blocking I/O is going to have keep its own buffer of data waiting
to be written to the Buffered IO object.  That's a pain and needlessly
redundant.

One could just set the buffer "large enough" for the applications
current needs, but this can lead to strange failures later when the
application needs to hold buffer_size+1 bytes in the buffer and
suddenly dies.

[1] = "reliable" in the sense of "no data loss unless the connection drops"

-- 
Daniel Stutzbach, Ph.D.             President, Stutzbach Enterprises LLC


More information about the Python-3000 mailing list