changeset: 97902:77784422da4d branch: 2.7 parent: 97896:1a52db3ef0e8 user: Martin Panter date: Fri Sep 11 03:58:30 2015 +0000 files: Doc/library/io.rst Misc/ACKS Modules/_io/bytesio.c description: Issue #25030: Do not document seek() as if it accepts keyword arguments Patch from Shiyao Ma. diff -r 1a52db3ef0e8 -r 77784422da4d Doc/library/io.rst --- a/Doc/library/io.rst Fri Sep 11 02:45:10 2015 +0000 +++ b/Doc/library/io.rst Fri Sep 11 03:58:30 2015 +0000 @@ -299,11 +299,11 @@ 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 @@ 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 diff -r 1a52db3ef0e8 -r 77784422da4d Misc/ACKS --- a/Misc/ACKS Fri Sep 11 02:45:10 2015 +0000 +++ b/Misc/ACKS Fri Sep 11 03:58:30 2015 +0000 @@ -1257,6 +1257,7 @@ Pete Shinners Michael Shiplett John W. Shipman +Shiyao Ma Joel Shprentz Yue Shuaijie Terrel Shumway diff -r 1a52db3ef0e8 -r 77784422da4d Modules/_io/bytesio.c --- a/Modules/_io/bytesio.c Fri Sep 11 02:45:10 2015 +0000 +++ b/Modules/_io/bytesio.c Fri Sep 11 03:58:30 2015 +0000 @@ -490,7 +490,7 @@ } 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"