I'm most interested in the design decision that led to Python 2.x's write() function returning None instead of the number of bytes written. It would imply some different mental model for the File object -- that it's not just a lightweight wrapper around a UNIX file descriptor.
Here's the documentation I'm referring to: http://docs.python.org/library/stdtypes.html#file.write
From Python official Manual 3.2.2:-
write(b)
Write the bytes or bytearray object, b and return the number of bytes written. When in non-blocking mode, a BlockingIOError is raised if the buffer needs to be written out but the raw stream blocks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With