diff options
author | Erlend E. Aasland <erlend@python.org> | 2023-08-18 17:53:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-18 17:53:51 (GMT) |
commit | dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9 (patch) | |
tree | 8cc7ae0459d623a8f5dc23b6aa13467caa987523 /Modules/posixmodule.c | |
parent | 6db39b1460727e8820b45e5c083e5839af0352aa (diff) | |
download | cpython-dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9.zip cpython-dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9.tar.gz cpython-dd4442c8f597af1ec3eaf20f7ad89c4ac7e2dbc9.tar.bz2 |
gh-107801: Improve the accuracy of os.lseek docs (#107935)
- name the last parameter *whence*, like it is for seek() methods on
file objects
- add param docstrings
- structure the valid *whence* params
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c391aab..8026080 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -10424,19 +10424,24 @@ os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length) os.lseek -> Py_off_t fd: int + An open file descriptor, as returned by os.open(). position: Py_off_t - how: int + Position, interpreted relative to 'whence'. + whence as how: int + The relative position to seek from. Valid values are: + - SEEK_SET: seek from the start of the file. + - SEEK_CUR: seek from the current file position. + - SEEK_END: seek from the end of the file. / Set the position of a file descriptor. Return the new position. -Return the new cursor position in number of bytes -relative to the beginning of the file. +The return value is the number of bytes relative to the beginning of the file. [clinic start generated code]*/ static Py_off_t os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how) -/*[clinic end generated code: output=971e1efb6b30bd2f input=902654ad3f96a6d3]*/ +/*[clinic end generated code: output=971e1efb6b30bd2f input=f096e754c5367504]*/ { Py_off_t result; |