Clarify acceptable values for BZ2File.__init__'s mode argument.

This commit is contained in:
Nadeem Vawda 2012-06-04 23:31:22 +02:00
parent aebcdba829
commit 50cb936bd0
2 changed files with 7 additions and 5 deletions

View file

@ -35,9 +35,11 @@ All of the classes in this module may safely be accessed from multiple threads.
be used to read or write the compressed data. be used to read or write the compressed data.
The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for
overwriting, or ``'a'`` for appending. If *filename* is a file object (rather overwriting, or ``'a'`` for appending. These can equivalently be given as
than an actual file name), a mode of ``'w'`` does not truncate the file, and ``'rb'``, ``'wb'``, and ``'ab'`` respectively.
is instead equivalent to ``'a'``.
If *filename* is a file object (rather than an actual file name), a mode of
``'w'`` does not truncate the file, and is instead equivalent to ``'a'``.
The *buffering* argument is ignored. Its use is deprecated. The *buffering* argument is ignored. Its use is deprecated.

View file

@ -46,8 +46,8 @@ class BZ2File(io.BufferedIOBase):
be opened. Otherwise, it should be a file object, which will be used to be opened. Otherwise, it should be a file object, which will be used to
read or write the compressed data. read or write the compressed data.
mode can be 'r' for reading (default), 'w' for (over)writing, or mode can be 'r' for reading (default), 'w' for (over)writing, or 'a' for
'a' for appending. appending. These can equivalently be given as 'rb', 'wb', and 'ab'.
buffering is ignored. Its use is deprecated. buffering is ignored. Its use is deprecated.