]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #25030: Do not document seek() as if it accepts keyword arguments
authorMartin Panter <vadmium>
Fri, 11 Sep 2015 03:58:30 +0000 (03:58 +0000)
committerMartin Panter <vadmium>
Fri, 11 Sep 2015 03:58:30 +0000 (03:58 +0000)
Patch from Shiyao Ma.

Doc/library/io.rst
Misc/ACKS
Modules/_io/bytesio.c

index ab5a0436078fc26880e04a8460868e4aebfba935..33cbb7e781a13e2d1c40a8e3e0245d8ee11022e4 100644 (file)
@@ -299,11 +299,11 @@ I/O Base Classes
       Note that it's already possible to iterate on file objects using ``for
       line in file: ...`` without calling ``file.readlines()``.
 
-   .. method:: seek(offset, whence=SEEK_SET)
+   .. method:: seek(offset[, whence])
 
       Change the stream position to the given byte *offset*.  *offset* is
-      interpreted relative to the position indicated by *whence*.  Values for
-      *whence* are:
+      interpreted relative to the position indicated by *whence*.  The default
+      value for *whence* is :data:`SEEK_SET`.  Values for *whence* are:
 
       * :data:`SEEK_SET` or ``0`` -- start of the stream (the default);
         *offset* should be zero or positive
@@ -716,10 +716,11 @@ Text I/O
 
       If *limit* is specified, at most *limit* characters will be read.
 
-   .. method:: seek(offset, whence=SEEK_SET)
+   .. method:: seek(offset[, whence])
 
-      Change the stream position to the given *offset*.  Behaviour depends
-      on the *whence* parameter:
+      Change the stream position to the given *offset*.  Behaviour depends on
+      the *whence* parameter.  The default value for *whence* is
+      :data:`SEEK_SET`.
 
       * :data:`SEEK_SET` or ``0``: seek from the start of the stream
         (the default); *offset* must either be a number returned by
index 5650f9b053f88ef6b5dfecef0f51c6f57f10320e..b13fe457b6d842d40f5eeb9602cc0e063dfd3147 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1257,6 +1257,7 @@ Alexander Shigin
 Pete Shinners
 Michael Shiplett
 John W. Shipman
+Shiyao Ma
 Joel Shprentz
 Yue Shuaijie
 Terrel Shumway
index 64983206477d50cd8533cae36da1fa723c0302ce..f643e9124d5fd363ded0ce4b56f9001b913deef8 100644 (file)
@@ -490,7 +490,7 @@ bytesio_iternext(bytesio *self)
 }
 
 PyDoc_STRVAR(seek_doc,
-"seek(pos, whence=0) -> int.  Change stream position.\n"
+"seek(pos[, whence]) -> int.  Change stream position.\n"
 "\n"
 "Seek to byte offset pos relative to position indicated by whence:\n"
 "     0  Start of stream (the default).  pos should be >= 0;\n"