Added buffered asynchronous I/O mode to Stdio.File In this mode the input and output is kept in buffers in the file object. Adding data to the output buffer will write it to the filedescriptor, and the read callback will receive the input buffer as its argument. The write callback will have the output buffer as a second argument, but most of the time this can be ignored since you keep the buffer object around. The write callback will only be called if the buffer needs more data, so if you implement a range_error function in the buffer that refills the buffer it will only be called once that callback returns 0.