summaryrefslogtreecommitdiff
path: root/Modules/_io/bytesio.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 +0000
commit6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85 (patch)
tree0f97c3f8b3fac65680e880ec870796138af78faf /Modules/_io/bytesio.c
parentfc36e66af46957a65b12ab0087027727f8555aed (diff)
downloadcpython-git-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.tar.gz
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/bytesio.c')
-rw-r--r--Modules/_io/bytesio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 058df477bd..9e5d78b166 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -548,7 +548,7 @@ _io.BytesIO.readinto
buffer: Py_buffer(accept={rwbuffer})
/
-Read up to len(buffer) bytes into buffer.
+Read bytes into buffer.
Returns number of bytes read (0 for EOF), or None if the object
is set not to block and has no data to read.
@@ -556,7 +556,7 @@ is set not to block and has no data to read.
static PyObject *
_io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer)
-/*[clinic end generated code: output=a5d407217dcf0639 input=b52a8782706f0037]*/
+/*[clinic end generated code: output=a5d407217dcf0639 input=1424d0fdce857919]*/
{
Py_ssize_t len, n;