Commit db4220ea authored by Martin Panter's avatar Martin Panter

Issue #25030: Do not document seek() as if it accepts keyword arguments

Patch from Shiyao Ma.
parent 91c03e09
...@@ -301,11 +301,11 @@ I/O Base Classes ...@@ -301,11 +301,11 @@ I/O Base Classes
Note that it's already possible to iterate on file objects using ``for Note that it's already possible to iterate on file objects using ``for
line in file: ...`` without calling ``file.readlines()``. 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 Change the stream position to the given byte *offset*. *offset* is
interpreted relative to the position indicated by *whence*. Values for interpreted relative to the position indicated by *whence*. The default
*whence* are: value for *whence* is :data:`SEEK_SET`. Values for *whence* are:
* :data:`SEEK_SET` or ``0`` -- start of the stream (the default); * :data:`SEEK_SET` or ``0`` -- start of the stream (the default);
*offset* should be zero or positive *offset* should be zero or positive
...@@ -760,10 +760,11 @@ Text I/O ...@@ -760,10 +760,11 @@ Text I/O
If *size* is specified, at most *size* characters will be read. If *size* is specified, at most *size* characters will be read.
.. method:: seek(offset, whence=SEEK_SET) .. method:: seek(offset[, whence])
Change the stream position to the given *offset*. Behaviour depends Change the stream position to the given *offset*. Behaviour depends on
on the *whence* parameter: the *whence* parameter. The default value for *whence* is
:data:`SEEK_SET`.
* :data:`SEEK_SET` or ``0``: seek from the start of the stream * :data:`SEEK_SET` or ``0``: seek from the start of the stream
(the default); *offset* must either be a number returned by (the default); *offset* must either be a number returned by
......
...@@ -1276,6 +1276,7 @@ Alexander Shigin ...@@ -1276,6 +1276,7 @@ Alexander Shigin
Pete Shinners Pete Shinners
Michael Shiplett Michael Shiplett
John W. Shipman John W. Shipman
Shiyao Ma
Alex Shkop Alex Shkop
Joel Shprentz Joel Shprentz
Yue Shuaijie Yue Shuaijie
......
...@@ -530,7 +530,7 @@ bytesio_iternext(bytesio *self) ...@@ -530,7 +530,7 @@ bytesio_iternext(bytesio *self)
} }
PyDoc_STRVAR(seek_doc, PyDoc_STRVAR(seek_doc,
"seek(pos, whence=0) -> int. Change stream position.\n" "seek(pos[, whence]) -> int. Change stream position.\n"
"\n" "\n"
"Seek to byte offset pos relative to position indicated by whence:\n" "Seek to byte offset pos relative to position indicated by whence:\n"
" 0 Start of stream (the default). pos should be >= 0;\n" " 0 Start of stream (the default). pos should be >= 0;\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment