Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 173d410 commit d8f870dCopy full SHA for d8f870d
1 file changed
Doc/library/contextlib.rst
@@ -259,11 +259,12 @@ Functions and classes provided:
259
260
with ExitStack() as stack:
261
files = [stack.enter_context(open(fname)) for fname in filenames]
262
- close_files = stack.pop_all().close()
+ # Hold onto the close method, but don't call it yet.
263
+ close_files = stack.pop_all().close
264
# If opening any file fails, all previously opened files will be
265
# closed automatically. If all files are opened successfully,
266
# they will remain open even after the with statement ends.
- # close_files() can then be invoked explicitly to close them all
267
+ # close_files() can then be invoked explicitly to close them all.
268
269
.. method:: close()
270
0 commit comments