Commit 71ce03df authored by Colin Watson's avatar Colin Watson Committed by Cheryl Sabella

Clarify file-closing example in tutorial (GH-11652)

parent 36c41bc2
...@@ -322,6 +322,8 @@ equivalent :keyword:`try`\ -\ :keyword:`finally` blocks:: ...@@ -322,6 +322,8 @@ equivalent :keyword:`try`\ -\ :keyword:`finally` blocks::
>>> with open('workfile') as f: >>> with open('workfile') as f:
... read_data = f.read() ... read_data = f.read()
>>> # We can check that the file has been automatically closed.
>>> f.closed >>> f.closed
True True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment