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/bytesio.c b/Modules/_io/bytesio.c
index d575236..1335ae8 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -392,7 +392,7 @@
}
PyDoc_STRVAR(readinto_doc,
-"readinto(bytearray) -> int. Read up to len(b) bytes into b.\n"
+"readinto(b) -> int. Read up to len(b) bytes into b.\n"
"\n"
"Returns number of bytes read (0 for EOF), or None if the object\n"
"is set not to block and has no data to read.");