[Python-Dev] Draft PEP to make file objects support non-blocking
mode.
James Y Knight
foom at fuhm.net
Sat Mar 19 02:41:25 CET 2005
On Mar 18, 2005, at 8:19 PM, Greg Ward wrote:
> Is having to use fcntl and os really so awful? At least it requires
> the programmer to prove he knows what he's doing putting this file
> into non-blocking mode, and that he really wants to do it. ;-)
I'd tend to agree. :) Moreover, I don't think fread/fwrite are
guaranteed to work as you would expect with non-blocking file
descriptors. So, providing a setblocking() call to files would require
calling read/write instead of fread/fwrite in all the file methods, at
least when in non-blocking mode. I don't think that's a good idea.
James
More information about the Python-Dev
mailing list