diff -r 5f1d5e1f6c1a Doc/library/zipfile.rst --- a/Doc/library/zipfile.rst Mon Sep 01 12:33:41 2014 +0300 +++ b/Doc/library/zipfile.rst Mon Sep 01 17:38:34 2014 -0400 @@ -210,6 +210,13 @@ password used for encrypted files. Calling :meth:`.open` on a closed ZipFile will raise a :exc:`RuntimeError`. + ZipFile.open is also a context manager and therefore supports the + :keyword:`with` statement.:: + + with ZipFile('spam.zip', 'w') as myzip: + with myzip.open('eggs.txt', r) as myfile: + print(myfile.read()) + .. note:: The file-like object is read-only and provides the following methods: