Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6d83429a
Commit
6d83429a
authored
Mar 09, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gzip and bz2 are context managers
parent
38f1bf67
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
Doc/library/bz2.rst
Doc/library/bz2.rst
+5
-0
Doc/library/gzip.rst
Doc/library/gzip.rst
+5
-0
No files found.
Doc/library/bz2.rst
View file @
6d83429a
...
@@ -60,6 +60,11 @@ Handling of compressed files is offered by the :class:`BZ2File` class.
...
@@ -60,6 +60,11 @@ Handling of compressed files is offered by the :class:`BZ2File` class.
reading. Instances support iteration in the same way as normal :class:`file`
reading. Instances support iteration in the same way as normal :class:`file`
instances.
instances.
:class:`BZ2File` supports the :keyword:`with` statement.
.. versionchanged:: 2.7
Support for the :keyword:`with` statement was added.
.. method:: close()
.. method:: close()
...
...
Doc/library/gzip.rst
View file @
6d83429a
...
@@ -67,6 +67,11 @@ The module defines the following items:
...
@@ -67,6 +67,11 @@ The module defines the following items:
writing as *fileobj*, and retrieve the resulting memory buffer using the
writing as *fileobj*, and retrieve the resulting memory buffer using the
:class:`StringIO` object's :meth:`getvalue` method.
:class:`StringIO` object's :meth:`getvalue` method.
:class:`GzipFile` supports the :keyword:`with` statement.
.. versionchanged:: 2.7
Support for the :keyword:`with` statement was added.
.. function:: open(filename[, mode[, compresslevel]])
.. function:: open(filename[, mode[, compresslevel]])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment