]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Doc: Add a link to tutorial page from `open()` doc (GH-21737)
authorBenjamin Kane <bbkane@users.noreply.github.com>
Sat, 8 Aug 2020 02:57:03 +0000 (19:57 -0700)
committerGitHub <noreply@github.com>
Sat, 8 Aug 2020 02:57:03 +0000 (11:57 +0900)
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.

Doc/library/functions.rst

index 3c36b59befab9154c118e6cf2d0c478d90cf4ae1..43c47c1da9434c3af1b7347de690ca72e6f186dc 100644 (file)
@@ -1055,7 +1055,8 @@ are always available.  They are listed here in alphabetical order.
 .. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
 
    Open *file* and return a corresponding :term:`file object`.  If the file
-   cannot be opened, an :exc:`OSError` is raised.
+   cannot be opened, an :exc:`OSError` is raised. See
+   :ref:`tut-files` for more examples of how to use this function.
 
    *file* is a :term:`path-like object` giving the pathname (absolute or
    relative to the current working directory) of the file to be opened or an