Clarify file-closing example in tutorial (GH-11652)
This commit is contained in:
parent
36c41bc201
commit
71ce03df9c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue