summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2023-08-18 12:16:42 (GMT)
committerGitHub <noreply@github.com>2023-08-18 12:16:42 (GMT)
commit2b8e0207cb91c5377ea82638d038e737070c64bb (patch)
tree22e180380a384cbcdac9e7fe7f1c997f7a800f83
parent60edc70a9374f1cc6ecff5974e438d58fec29985 (diff)
downloadcpython-2b8e0207cb91c5377ea82638d038e737070c64bb.zip
cpython-2b8e0207cb91c5377ea82638d038e737070c64bb.tar.gz
cpython-2b8e0207cb91c5377ea82638d038e737070c64bb.tar.bz2
[3.12] gh-107801: Improve the docs of the SEEK_* constants (#108099) (#108108)
(cherry picked from commit 02079b010c39a89b284e8f0bb6d5f378e554260e)
-rw-r--r--Doc/library/os.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 94b76e4..4668984 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1180,16 +1180,26 @@ as internal buffering of data.
SEEK_CUR
SEEK_END
- Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
- respectively.
+ Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
+ method on :term:`file-like objects <file object>`,
+ for whence to adjust the file position indicator.
+
+ :const:`SEEK_SET`
+ Adjust the file position relative to the beginning of the file.
+ :const:`SEEK_CUR`
+ Adjust the file position relative to the current file position.
+ :const:`SEEK_END`
+ Adjust the file position relative to the end of the file.
+
+ Their values are 0, 1, and 2, respectively.
.. data:: SEEK_HOLE
SEEK_DATA
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
- method on file objects, for seeking file data and holes on sparsely
- allocated files.
+ method on :term:`file-like objects <file object>`,
+ for seeking file data and holes on sparsely allocated files.
:data:`!SEEK_DATA`
Adjust the file offset to the next location containing data,