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/fileio.c b/Modules/_io/fileio.c
index 098aef4..74b2305 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -969,7 +969,7 @@
"or None if no data is available. On end-of-file, returns ''.");
PyDoc_STRVAR(write_doc,
-"write(b: bytes) -> int. Write bytes b to file, return number written.\n"
+"write(b) -> int. Write array of bytes b, return number written.\n"
"\n"
"Only makes one system call, so not all of the data may be written.\n"
"The number of bytes actually written is returned. In non-blocking mode,\n"