Skip to content

Commit deea701

Browse files
Doc: Add a link to tutorial page from open() doc (GH-21737)
Adds a link to the "Reading and Writing Files" page so users can more easily discover how file handles are handled with the `with` context manager vs without it. (cherry picked from commit 705f145) Co-authored-by: Benjamin Kane <[email protected]>
1 parent 70e9243 commit deea701

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,8 @@ are always available. They are listed here in alphabetical order.
10411041
.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
10421042

10431043
Open *file* and return a corresponding :term:`file object`. If the file
1044-
cannot be opened, an :exc:`OSError` is raised.
1044+
cannot be opened, an :exc:`OSError` is raised. See
1045+
:ref:`tut-files` for more examples of how to use this function.
10451046

10461047
*file* is a :term:`path-like object` giving the pathname (absolute or
10471048
relative to the current working directory) of the file to be opened or an

0 commit comments

Comments
 (0)