Skip to content

Commit 02079b0

Browse files
gh-107801: Improve the docs of the SEEK_* constants (#108099)
1 parent 5c76899 commit 02079b0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Doc/library/os.rst

+14-4
Original file line numberDiff line numberDiff line change
@@ -1180,16 +1180,26 @@ as internal buffering of data.
11801180
SEEK_CUR
11811181
SEEK_END
11821182

1183-
Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
1184-
respectively.
1183+
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
1184+
method on :term:`file-like objects <file object>`,
1185+
for whence to adjust the file position indicator.
1186+
1187+
:const:`SEEK_SET`
1188+
Adjust the file position relative to the beginning of the file.
1189+
:const:`SEEK_CUR`
1190+
Adjust the file position relative to the current file position.
1191+
:const:`SEEK_END`
1192+
Adjust the file position relative to the end of the file.
1193+
1194+
Their values are 0, 1, and 2, respectively.
11851195

11861196

11871197
.. data:: SEEK_HOLE
11881198
SEEK_DATA
11891199

11901200
Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek`
1191-
method on file objects, for seeking file data and holes on sparsely
1192-
allocated files.
1201+
method on :term:`file-like objects <file object>`,
1202+
for seeking file data and holes on sparsely allocated files.
11931203

11941204
:data:`!SEEK_DATA`
11951205
Adjust the file offset to the next location containing data,

0 commit comments

Comments
 (0)