Skip to content

Commit d6555ab

Browse files
[3.11] gh-107801: Improve the docs of the SEEK_* constants (GH-108099) (#108100)
(cherry picked from commit 02079b0) Co-authored-by: Erlend E. Aasland <erlend@python.org>
1 parent b389939 commit d6555ab

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Doc/library/os.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,26 @@ as internal buffering of data.
10701070
SEEK_CUR
10711071
SEEK_END
10721072

1073-
Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
1074-
respectively.
1073+
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
1074+
method on :term:`file-like objects <file object>`,
1075+
for whence to adjust the file position indicator.
1076+
1077+
:const:`SEEK_SET`
1078+
Adjust the file position relative to the beginning of the file.
1079+
:const:`SEEK_CUR`
1080+
Adjust the file position relative to the current file position.
1081+
:const:`SEEK_END`
1082+
Adjust the file position relative to the end of the file.
1083+
1084+
Their values are 0, 1, and 2, respectively.
10751085

10761086

10771087
.. data:: SEEK_HOLE
10781088
SEEK_DATA
10791089

10801090
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
1081-
method on file objects, for seeking file data and holes on sparsely
1082-
allocated files.
1091+
method on :term:`file-like objects <file object>`,
1092+
for seeking file data and holes on sparsely allocated files.
10831093

10841094
:data:`!SEEK_DATA`
10851095
Adjust the file offset to the next location containing data,

0 commit comments

Comments
 (0)