[Python-checkins] cpython (3.4): Replaced "string" with "bytes object" in docstrings of binary I/O objects.

serhiy.storchaka python-checkins at python.org
Fri Apr 10 01:20:40 CEST 2015


https://hg.python.org/cpython/rev/98b4450f0a0a
changeset:   95508:98b4450f0a0a
branch:      3.4
parent:      95506:ce29f3f9271c
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Apr 10 02:18:44 2015 +0300
summary:
  Replaced "string" with "bytes object" in docstrings of binary I/O objects.

files:
  Modules/_io/bytesio.c |  20 ++++++++++----------
  Modules/_io/fileio.c  |   6 +++---
  2 files changed, 13 insertions(+), 13 deletions(-)


diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -258,10 +258,10 @@
 }
 
 PyDoc_STRVAR(read_doc,
-"read([size]) -> read at most size bytes, returned as a string.\n"
+"read([size]) -> read at most size bytes, returned as a bytes object.\n"
 "\n"
 "If the size argument is negative, read until EOF is reached.\n"
-"Return an empty string at EOF.");
+"Return an empty bytes object at EOF.");
 
 static PyObject *
 bytesio_read(bytesio *self, PyObject *args)
@@ -307,10 +307,10 @@
 
 
 PyDoc_STRVAR(read1_doc,
-"read1(size) -> read at most size bytes, returned as a string.\n"
+"read1(size) -> read at most size bytes, returned as a bytes object.\n"
 "\n"
 "If the size argument is negative or omitted, read until EOF is reached.\n"
-"Return an empty string at EOF.");
+"Return an empty bytes object at EOF.");
 
 static PyObject *
 bytesio_read1(bytesio *self, PyObject *n)
@@ -326,11 +326,11 @@
 }
 
 PyDoc_STRVAR(readline_doc,
-"readline([size]) -> next line from the file, as a string.\n"
+"readline([size]) -> next line from the file, as a bytes object.\n"
 "\n"
 "Retain newline.  A non-negative size argument limits the maximum\n"
 "number of bytes to return (an incomplete line may be returned then).\n"
-"Return an empty string at EOF.\n");
+"Return an empty bytes object at EOF.\n");
 
 static PyObject *
 bytesio_readline(bytesio *self, PyObject *args)
@@ -615,11 +615,11 @@
 }
 
 PyDoc_STRVAR(writelines_doc,
-"writelines(sequence_of_strings) -> None.  Write strings to the file.\n"
+"writelines(lines) -> None.  Write bytes objects to the file.\n"
 "\n"
-"Note that newlines are not added.  The sequence can be any iterable\n"
-"object producing strings. This is equivalent to calling write() for\n"
-"each string.");
+"Note that newlines are not added.  The argument can be any iterable\n"
+"object producing bytes objects. This is equivalent to calling write() for\n"
+"each bytes object.");
 
 static PyObject *
 bytesio_writelines(bytesio *self, PyObject *v)
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -667,7 +667,7 @@
             if (bufsize > PY_SSIZE_T_MAX || bufsize <= 0) {
                 PyErr_SetString(PyExc_OverflowError,
                                 "unbounded read returned more bytes "
-                                "than a Python string can hold");
+                                "than a Python bytes object can hold");
                 Py_DECREF(result);
                 return NULL;
             }
@@ -1111,13 +1111,13 @@
 "\n"
 "Only makes one system call, so less data may be returned than requested\n"
 "In non-blocking mode, returns None if no data is available.\n"
-"On end-of-file, returns ''.");
+"Return an empty bytes object at EOF.");
 
 PyDoc_STRVAR(readall_doc,
 "readall() -> bytes.  read all data from the file, returned as bytes.\n"
 "\n"
 "In non-blocking mode, returns as much as is immediately available,\n"
-"or None if no data is available.  On end-of-file, returns ''.");
+"or None if no data is available.  Return an empty bytes object at EOF.");
 
 PyDoc_STRVAR(write_doc,
 "write(b: bytes) -> int.  Write bytes b to file, return number written.\n"

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list