summaryrefslogtreecommitdiffstats
path: root/Modules/_io/clinic
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 (GMT)
commit6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85 (patch)
tree0f97c3f8b3fac65680e880ec870796138af78faf /Modules/_io/clinic
parentfc36e66af46957a65b12ab0087027727f8555aed (diff)
downloadcpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.zip
cpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.tar.gz
cpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.tar.bz2
Issue #20699: Document that “io” methods accept bytes-like objects
This matches the usage of ZipFile and BufferedWriter. This still requires return values to be bytes() objects. Also document and test that the write() methods should only access their argument before they return.
Diffstat (limited to 'Modules/_io/clinic')
-rw-r--r--Modules/_io/clinic/bytesio.c.h4
-rw-r--r--Modules/_io/clinic/fileio.c.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h
index e468215..5f2abb0 100644
--- a/Modules/_io/clinic/bytesio.c.h
+++ b/Modules/_io/clinic/bytesio.c.h
@@ -259,7 +259,7 @@ PyDoc_STRVAR(_io_BytesIO_readinto__doc__,
"readinto($self, buffer, /)\n"
"--\n"
"\n"
-"Read up to len(buffer) bytes into buffer.\n"
+"Read bytes into buffer.\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.");
@@ -419,4 +419,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=164cf0e4117dadbe input=a9049054013a1b77]*/
+/*[clinic end generated code: output=60ce2c6272718431 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h
index 4a1205e..1042008 100644
--- a/Modules/_io/clinic/fileio.c.h
+++ b/Modules/_io/clinic/fileio.c.h
@@ -222,7 +222,7 @@ PyDoc_STRVAR(_io_FileIO_write__doc__,
"write($self, b, /)\n"
"--\n"
"\n"
-"Write bytes b to file, return number written.\n"
+"Write buffer b to file, return number of bytes 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"
@@ -364,4 +364,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=b1a20b10c81add64 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dcbc39b466598492 input=a9049054013a1b77]*/