Issue #20699: Document that “io” methods should accept memoryview
This matches the usage by BufferedReader, BufferedWriter, etc. Also document
and test that the write() methods should only access their argument before
they return.
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 600bf8a..5bef746 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -125,8 +125,7 @@
PyDoc_STRVAR(bufferediobase_write_doc,
"Write the given buffer to the IO stream.\n"
"\n"
- "Returns the number of bytes written, which is never less than\n"
- "len(b).\n"
+ "Returns the number of bytes written, which is always len(b).\n"
"\n"
"Raises BlockingIOError if the buffer is full and the\n"
"underlying raw stream cannot accept more data at the moment.\n");