[Python-checkins] bpo-32747: Remove trailing spaces in docstrings. (GH-5491)

Serhiy Storchaka webhook-mailer at python.org
Fri Feb 2 03:52:59 EST 2018


https://github.com/python/cpython/commit/aa0735f597b072c0eb00404c4d7df359ddc26755
commit: aa0735f597b072c0eb00404c4d7df359ddc26755
branch: master
author: oldk <oldk1331 at users.noreply.github.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2018-02-02T10:52:55+02:00
summary:

bpo-32747: Remove trailing spaces in docstrings. (GH-5491)

files:
M Modules/_csv.c
M Modules/_threadmodule.c
M Modules/arraymodule.c
M Modules/fcntlmodule.c
M Modules/itertoolsmodule.c
M Modules/posixmodule.c
M Modules/selectmodule.c
M Modules/socketmodule.c
M Objects/odictobject.c
M Objects/unicodeobject.c
M PC/winreg.c
M Python/sysmodule.c

diff --git a/Modules/_csv.c b/Modules/_csv.c
index e616151bae63..610f7bb06325 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -1523,15 +1523,15 @@ PyDoc_STRVAR(csv_module_doc,
 "\n"
 "SETTINGS:\n"
 "\n"
-"    * quotechar - specifies a one-character string to use as the \n"
+"    * quotechar - specifies a one-character string to use as the\n"
 "        quoting character.  It defaults to '\"'.\n"
-"    * delimiter - specifies a one-character string to use as the \n"
+"    * delimiter - specifies a one-character string to use as the\n"
 "        field separator.  It defaults to ','.\n"
 "    * skipinitialspace - specifies how to interpret whitespace which\n"
 "        immediately follows a delimiter.  It defaults to False, which\n"
 "        means that whitespace immediately following a delimiter is part\n"
 "        of the following field.\n"
-"    * lineterminator -  specifies the character sequence which should \n"
+"    * lineterminator -  specifies the character sequence which should\n"
 "        terminate rows.\n"
 "    * quoting - controls when quotes should be generated by the writer.\n"
 "        It can take on any of the following module constants:\n"
@@ -1543,7 +1543,7 @@ PyDoc_STRVAR(csv_module_doc,
 "            fields which do not parse as integers or floating point\n"
 "            numbers.\n"
 "        csv.QUOTE_NONE means that quotes are never placed around fields.\n"
-"    * escapechar - specifies a one-character string used to escape \n"
+"    * escapechar - specifies a one-character string used to escape\n"
 "        the delimiter when quoting is set to QUOTE_NONE.\n"
 "    * doublequote - controls the handling of quotes inside fields.  When\n"
 "        True, two consecutive quotes are interpreted as one during read,\n"
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index f594bda678a8..43898d838bea 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -1162,7 +1162,7 @@ PyDoc_STRVAR(_count_doc,
 "_count() -> integer\n\
 \n\
 \
-Return the number of currently running Python threads, excluding \n\
+Return the number of currently running Python threads, excluding\n\
 the main thread. The returned number comprises all threads created\n\
 through `start_new_thread()` as well as `threading.Thread`, and not\n\
 yet finished.\n\
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 900c374c585e..6a9ff3ec6252 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2772,26 +2772,26 @@ the type of objects stored in them is constrained. The type is specified\n\
 at object creation time by using a type code, which is a single character.\n\
 The following type codes are defined:\n\
 \n\
-    Type code   C Type             Minimum size in bytes \n\
-    'b'         signed integer     1 \n\
-    'B'         unsigned integer   1 \n\
-    'u'         Unicode character  2 (see note) \n\
-    'h'         signed integer     2 \n\
-    'H'         unsigned integer   2 \n\
-    'i'         signed integer     2 \n\
-    'I'         unsigned integer   2 \n\
-    'l'         signed integer     4 \n\
-    'L'         unsigned integer   4 \n\
-    'q'         signed integer     8 (see note) \n\
-    'Q'         unsigned integer   8 (see note) \n\
-    'f'         floating point     4 \n\
-    'd'         floating point     8 \n\
+    Type code   C Type             Minimum size in bytes\n\
+    'b'         signed integer     1\n\
+    'B'         unsigned integer   1\n\
+    'u'         Unicode character  2 (see note)\n\
+    'h'         signed integer     2\n\
+    'H'         unsigned integer   2\n\
+    'i'         signed integer     2\n\
+    'I'         unsigned integer   2\n\
+    'l'         signed integer     4\n\
+    'L'         unsigned integer   4\n\
+    'q'         signed integer     8 (see note)\n\
+    'Q'         unsigned integer   8 (see note)\n\
+    'f'         floating point     4\n\
+    'd'         floating point     8\n\
 \n\
-NOTE: The 'u' typecode corresponds to Python's unicode character. On \n\
+NOTE: The 'u' typecode corresponds to Python's unicode character. On\n\
 narrow builds this is 2-bytes on wide builds this is 4-bytes.\n\
 \n\
-NOTE: The 'q' and 'Q' type codes are only available if the platform \n\
-C compiler used to build Python supports 'long long', or, on Windows, \n\
+NOTE: The 'q' and 'Q' type codes are only available if the platform\n\
+C compiler used to build Python supports 'long long', or, on Windows,\n\
 '__int64'.\n\
 \n\
 Methods:\n\
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 0baaa83d2aca..77ddebf3ee0d 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -430,7 +430,7 @@ static PyMethodDef fcntl_methods[] = {
 
 
 PyDoc_STRVAR(module_doc,
-"This module performs file control and I/O control on file \n\
+"This module performs file control and I/O control on file\n\
 descriptors.  It is an interface to the fcntl() and ioctl() Unix\n\
 routines.  File descriptors can be obtained with the fileno() method of\n\
 a file or socket object.");
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 1113fb6b76c0..e0810c85c12b 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1358,7 +1358,7 @@ static PyMethodDef takewhile_reduce_methods[] = {
 PyDoc_STRVAR(takewhile_doc,
 "takewhile(predicate, iterable) --> takewhile object\n\
 \n\
-Return successive entries from an iterable as long as the \n\
+Return successive entries from an iterable as long as the\n\
 predicate evaluates to true for each entry.");
 
 static PyTypeObject takewhile_type = {
@@ -1616,7 +1616,7 @@ islice(iterable, start, stop[, step]) --> islice object\n\
 Return an iterator whose next() method returns selected values from an\n\
 iterable.  If start is specified, will skip all preceding elements;\n\
 otherwise, start defaults to zero.  Step defaults to one.  If\n\
-specified as another value, step determines how many values are \n\
+specified as another value, step determines how many values are\n\
 skipped between successive calls.  Works like a slice() on a list\n\
 but returns an iterator.");
 
@@ -4613,8 +4613,8 @@ repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\
 \n\
 Iterators terminating on the shortest input sequence:\n\
 accumulate(p[, func]) --> p0, p0+p1, p0+p1+p2\n\
-chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\
-chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ... \n\
+chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...\n\
+chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...\n\
 compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n\
 dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n\
 groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n\
@@ -4624,7 +4624,7 @@ islice(seq, [start,] stop [, step]) --> elements from\n\
 starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n\
 tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n\
 takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n\
-zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ... \n\
+zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n\
 \n\
 Combinatoric generators:\n\
 product(p, q, ... [repeat=1]) --> cartesian product\n\
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 4a1c9f398a07..84b5b993cdfc 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -11472,7 +11472,7 @@ PyDoc_STRVAR(termsize__doc__,
     "This function will only be defined if an implementation is\n"         \
     "available for this system.\n"                                         \
     "\n"                                                                   \
-    "shutil.get_terminal_size is the high-level function which should \n"  \
+    "shutil.get_terminal_size is the high-level function which should\n"  \
     "normally be used, os.get_terminal_size is the low-level implementation.");
 
 static PyObject*
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 3b7713abab36..fe2968af8091 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -516,7 +516,7 @@ poll_unregister(pollObject *self, PyObject *o)
 
 PyDoc_STRVAR(poll_poll_doc,
 "poll( [timeout] ) -> list of (fd, event) 2-tuples\n\n\
-Polls the set of registered file descriptors, returning a list containing \n\
+Polls the set of registered file descriptors, returning a list containing\n\
 any descriptors that have events or errors to report.");
 
 static PyObject *
@@ -877,7 +877,7 @@ devpoll_unregister(devpollObject *self, PyObject *o)
 
 PyDoc_STRVAR(devpoll_poll_doc,
 "poll( [timeout] ) -> list of (fd, event) 2-tuples\n\n\
-Polls the set of registered file descriptors, returning a list containing \n\
+Polls the set of registered file descriptors, returning a list containing\n\
 any descriptors that have events or errors to report.");
 
 static PyObject *
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 8cc5d14cbb20..ab3465a95f09 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2661,8 +2661,8 @@ sock_gettimeout(PySocketSockObject *s)
 PyDoc_STRVAR(gettimeout_doc,
 "gettimeout() -> timeout\n\
 \n\
-Returns the timeout in seconds (float) associated with socket \n\
-operations. A timeout of None indicates that timeouts on socket \n\
+Returns the timeout in seconds (float) associated with socket\n\
+operations. A timeout of None indicates that timeouts on socket\n\
 operations are disabled.");
 
 /* s.setsockopt() method.
@@ -2752,7 +2752,7 @@ setsockopt(level, option, value: buffer)\n\
 setsockopt(level, option, None, optlen: int)\n\
 \n\
 Set a socket option.  See the Unix manual for level and option.\n\
-The value argument can either be an integer, a string buffer, or \n\
+The value argument can either be an integer, a string buffer, or\n\
 None, optlen.");
 
 
@@ -3310,8 +3310,8 @@ sock_recv_into(PySocketSockObject *s, PyObject *args, PyObject *kwds)
 PyDoc_STRVAR(recv_into_doc,
 "recv_into(buffer, [nbytes[, flags]]) -> nbytes_read\n\
 \n\
-A version of recv() that stores its data into a buffer rather than creating \n\
-a new string.  Receive up to buffersize bytes from the socket.  If buffersize \n\
+A version of recv() that stores its data into a buffer rather than creating\n\
+a new string.  Receive up to buffersize bytes from the socket.  If buffersize\n\
 is not specified (or 0), receive up to the size available in the given buffer.\n\
 \n\
 See recv() for documentation about the flags.");
@@ -5772,7 +5772,7 @@ Convert a 16-bit unsigned integer from network to host byte order.\n\
 Note that in case the received integer does not fit in 16-bit unsigned\n\
 integer, but does fit in a positive C int, it is silently truncated to\n\
 16-bit unsigned integer.\n\
-However, this silent truncation feature is deprecated, and will raise an \n\
+However, this silent truncation feature is deprecated, and will raise an\n\
 exception in future versions of Python.");
 
 
@@ -5843,7 +5843,7 @@ Convert a 16-bit unsigned integer from host to network byte order.\n\
 Note that in case the received integer does not fit in 16-bit unsigned\n\
 integer, but does fit in a positive C int, it is silently truncated to\n\
 16-bit unsigned integer.\n\
-However, this silent truncation feature is deprecated, and will raise an \n\
+However, this silent truncation feature is deprecated, and will raise an\n\
 exception in future versions of Python.");
 
 
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index bf19fedb07f5..1796b968bfdd 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -866,7 +866,7 @@ PyDoc_STRVAR(odict_delitem__doc__, "od.__delitem__(y) <==> del od[y]");
 /* __eq__() */
 
 PyDoc_STRVAR(odict_eq__doc__,
-"od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive \n\
+"od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive\n\
         while comparison to a regular mapping is order-insensitive.\n\
         ");
 
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 3d9e09d7fab1..f5e4ab62a333 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -11595,7 +11595,7 @@ unicode_hash(PyObject *self)
 PyDoc_STRVAR(index__doc__,
              "S.index(sub[, start[, end]]) -> int\n\
 \n\
-Return the lowest index in S where substring sub is found, \n\
+Return the lowest index in S where substring sub is found,\n\
 such that sub is contained within S[start:end].  Optional\n\
 arguments start and end are interpreted as in slice notation.\n\
 \n\
diff --git a/PC/winreg.c b/PC/winreg.c
index ddaf3b1abc92..78864b1a69cf 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -83,7 +83,7 @@ PyDoc_STRVAR(PyHKEY_doc,
 "the object is destroyed.  To guarantee cleanup, you can call either\n"
 "the Close() method on the PyHKEY, or the CloseKey() method.\n"
 "\n"
-"All functions which accept a handle object also accept an integer - \n"
+"All functions which accept a handle object also accept an integer --\n"
 "however, use of the handle object is encouraged.\n"
 "\n"
 "Functions:\n"
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 873657f4a4f1..fb1dcfa3afe8 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -365,7 +365,7 @@ sys_getdefaultencoding(PyObject *self)
 PyDoc_STRVAR(getdefaultencoding_doc,
 "getdefaultencoding() -> string\n\
 \n\
-Return the current default string encoding used by the Unicode \n\
+Return the current default string encoding used by the Unicode\n\
 implementation."
 );
 
@@ -1122,7 +1122,7 @@ PyDoc_STRVAR(enablelegacywindowsfsencoding_doc,
 Changes the default filesystem encoding to mbcs:replace for consistency\n\
 with earlier versions of Python. See PEP 529 for more information.\n\
 \n\
-This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING \n\
+This is equivalent to defining the PYTHONLEGACYWINDOWSFSENCODING\n\
 environment variable before launching Python."
 );
 
@@ -1812,7 +1812,7 @@ winver -- [Windows only] version number of the Python DLL\n\
 #ifdef MS_WINDOWS
 /* concatenating string here */
 PyDoc_STR(
-"_enablelegacywindowsfsencoding -- [Windows only] \n\
+"_enablelegacywindowsfsencoding -- [Windows only]\n\
 "
 )
 #endif



More information about the Python-checkins mailing list