]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107801: Improve the docs of the SEEK_* constants (#108099)
authorErlend E. Aasland <erlend@python.org>
Thu, 17 Aug 2023 20:41:35 +0000 (22:41 +0200)
committerGitHub <noreply@github.com>
Thu, 17 Aug 2023 20:41:35 +0000 (20:41 +0000)
Doc/library/os.rst

index 94b76e4052b94b79873063a2acd706693821aab7..4668984b10c6904246762ddff0ee3860d8a3d878 100644 (file)
@@ -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,