diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-05-28 00:41:57 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-05-28 00:41:57 (GMT) |
commit | 6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85 (patch) | |
tree | 0f97c3f8b3fac65680e880ec870796138af78faf /Modules/_io/bufferedio.c | |
parent | fc36e66af46957a65b12ab0087027727f8555aed (diff) | |
download | cpython-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/bufferedio.c')
-rw-r--r-- | Modules/_io/bufferedio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 625a61e..6d67751 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -190,8 +190,8 @@ bufferediobase_read1(PyObject *self, PyObject *args) 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 the length of b\n" + "in bytes.\n" "\n" "Raises BlockingIOError if the buffer is full and the\n" "underlying raw stream cannot accept more data at the moment.\n"); |