Return whether object was opened for writing. If False, write() will raise OSError.
io/IOBase.writable
IOBase.writable