[issue1775] filehandle.write() does not return None (Python 3.0a2)

Guido van Rossum report at bugs.python.org
Wed Jan 9 16:10:00 CET 2008


Guido van Rossum added the comment:

The intention was that the lowest-level (unbuffered) stream object can
write fewer bytes than given to it, as it is a direct interface to the
underlying system call, which has this property (especially when the
file is in non-blocking mode).

I think it's fine to return None from the higher-level classes' write()
method (buffered and text).  Though this makes it a bit harder to switch
between buffered and unbuffered binary output.  Perhaps text I/O should
return None and bytes I/O should return a byte count?

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1775>
__________________________________


More information about the Python-bugs-list mailing list