[Python-3000] Draft PEP for New IO system

Josiah Carlson jcarlson at uci.edu
Thu Mar 1 18:26:19 CET 2007


"Daniel Stutzbach" <daniel.stutzbach at gmail.com> wrote:
[snip]
> The goal of supporting non-blocking file-like objects is to be able to
> use select() with buffered I/O objects (and other things like a
> compressed socket stream).

You can already pass sockets, files, and pipes to select (on linux, bsd,
etc.). Being able to pass files and pipes to select on Windows, seems to
me, a "doomed to fail" design goal - Windows select doesn't support them.
Windows IOCP, or even a WaitForMultipleObjects call *may*, but then it's
not select (unless the plan was to rewrite the select module for Windows).

And honestly, when I'm dealing with non-blocking objects, I much prefer
to deal with buffers myself, *especially* if I'm going to be putting
them in a select loop or equivalent.  Building-in buffering to
non-blocking sockets, files, and pipes, seems to be more than a little
bit of over-engineering (then again, the whole new IO system seems to be
over-engineered, I haven't had any issues with the *current* system, and
the new one with pluggable layers feels a bit like using Twisted for an
echo server - no offense to the Twisted folks).


 - Josiah



More information about the Python-3000 mailing list