[Python-checkins] Doc: Add a link to tutorial page from `open()` doc (GH-21737)

Benjamin Kane webhook-mailer at python.org
Fri Aug 7 22:57:11 EDT 2020


https://github.com/python/cpython/commit/705f14556545699ab615ec98f707b438f9603767
commit: 705f14556545699ab615ec98f707b438f9603767
branch: master
author: Benjamin Kane <bbkane at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-08-08T11:57:03+09:00
summary:

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.

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 3c36b59befab9..43c47c1da9434 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -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



More information about the Python-checkins mailing list