summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Watson <cjwatson@ubuntu.com>2019-04-17 12:18:37 (GMT)
committerCheryl Sabella <cheryl.sabella@gmail.com>2019-04-17 12:18:37 (GMT)
commit71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc (patch)
tree75e213dd6bd9d03d682bdbd7ee692d60864deed3
parent36c41bc2017921321dbb19557f616a6bb7572c83 (diff)
downloadcpython-71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc.zip
cpython-71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc.tar.gz
cpython-71ce03df9c643faa94fbdf73bbb4e99a9a62cbdc.tar.bz2
Clarify file-closing example in tutorial (GH-11652)
-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 7942786..fc2bd55 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