summaryrefslogtreecommitdiff
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorColin Watson <cjwatson@ubuntu.com>2019-04-17 13:18:37 +0100
committerCheryl Sabella <cheryl.sabella@gmail.com>2019-04-17 08:18:37 -0400
commit71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc (patch)
tree75e213dd6bd9d03d682bdbd7ee692d60864deed3 /Doc/tutorial
parent36c41bc2017921321dbb19557f616a6bb7572c83 (diff)
downloadcpython-git-71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc.tar.gz
Clarify file-closing example in tutorial (GH-11652)
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/inputoutput.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index 79427860f5..fc2bd5578c 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -322,6 +322,8 @@ equivalent :keyword:`try`\ -\ :keyword:`finally` blocks::
>>> with open('workfile') as f:
... read_data = f.read()
+
+ >>> # We can check that the file has been automatically closed.
>>> f.closed
True