@@ -24,7 +24,7 @@ \section{\module{bz2} ---
2424\item \class {BZ2File} class offers an optimized line iteration using
2525 the readahead algorithm borrowed from file objects;
2626\item \class {BZ2File} class developed inheriting builtin file type
27- (\code {isinstance (BZ2File() , file) == 1 });
27+ (\code {issubclass (BZ2File, file)} is \code {True });
2828\item Sequential (de)compression supported by \class {BZ2Compressor} and
2929 \class {BZ2Decompressor} classes;
3030\item One-shot (de)compression supported by \function {compress()} and
@@ -38,16 +38,18 @@ \subsection{(De)compression of files}
3838
3939Handling of compressed files is offered by the \class {BZ2File} class.
4040
41- \begin {classdesc }{BZ2File}{filename \optional {, mode='r' \optional {,
42- buffering=0 \optional {, compresslevel=9 }}}}
43- Open a bz2 file. Mode can be either \code {'r'} or \code {'w'}, for reading
41+ \begin {classdesc }{BZ2File}{filename\optional {, mode\optional {,
42+ buffering\optional {, compresslevel}}}}
43+ Open a bz2 file. Mode can be either \code {'r'} or \code {'w'}, for reading
4444(default) or writing. When opened for writing, the file will be created if
45- it doesn't exist, and truncated otherwise. If the buffering argument is given,
46- \code {0} means unbuffered, and larger numbers specify the buffer size. If
47- compresslevel is given, must be a number between \code {1} and \code {9}.
45+ it doesn't exist, and truncated otherwise. If \var {buffering} is given,
46+ \code {0} means unbuffered, and larger numbers specify the buffer size;
47+ the default is \code {0}. If
48+ \var {compresslevel} is given, must be a number between \code {1} and
49+ \code {9}; the default is \code {9}.
4850Add a \code {'U'} to mode to open the file for input with universal newline
4951support. Any line ending in the input file will be seen as a
50- \code {' \textbackslash n' }
52+ \character { \textbackslash n}
5153in Python. Also, a file so opened gains the attribute \member {newlines};
5254the value for this attribute is one of \code {None} (no newline read yet),
5355\code {'\textbackslash r'}, \code {'\textbackslash n'},
@@ -89,7 +91,7 @@ \subsection{(De)compression of files}
8991using the same readahead algorithm available in \class {file} objects.
9092\end {methoddesc }
9193
92- \begin {methoddesc }[BZ2File]{seek}{offset \optional {, whence}}
94+ \begin {methoddesc }[BZ2File]{seek}{offset\optional {, whence}}
9395Move to new file position. Argument \var {offset} is a byte count. Optional
9496argument \var {whence} defaults to \code {0} (offset from start of file,
9597offset should be \code {>= 0}); other values are \code {1} (move relative to
@@ -122,11 +124,12 @@ \subsection{Sequential (de)compression}
122124Sequential compression and decompression is done using the classes
123125\class {BZ2Compressor} and \class {BZ2Decompressor}.
124126
125- \begin {classdesc }{BZ2Compressor}{\optional {compresslevel=9 }}
127+ \begin {classdesc }{BZ2Compressor}{\optional {compresslevel}}
126128Create a new compressor object. This object may be used to compress
127129data sequentially. If you want to compress data in one shot, use the
128130\function {compress()} function instead. The \var {compresslevel} parameter,
129- if given, must be a number between \code {1} and \code {9}.
131+ if given, must be a number between \code {1} and \code {9}; the default
132+ is \code {9}.
130133\end {classdesc }
131134
132135\begin {methoddesc }[BZ2Compressor]{compress}{data}
@@ -161,14 +164,14 @@ \subsection{One-shot (de)compression}
161164One-shot compression and decompression is provided trough the
162165\function {compress()} and \function {decompress()} functions.
163166
164- \begin {funcdesc }{compress}{data\optional {, compresslevel=9 }}
167+ \begin {funcdesc }{compress}{data\optional {, compresslevel}}
165168Compress \var {data} in one shot. If you want to compress data sequentially,
166169use an instance of \class {BZ2Compressor} instead. The \var {compresslevel}
167- parameter, if given, must be a number between \code {1} and \code {9}.
170+ parameter, if given, must be a number between \code {1} and \code {9};
171+ the default is \code {9}.
168172\end {funcdesc }
169173
170- \begin {funcdesc }{decompress}{}
174+ \begin {funcdesc }{decompress}{data }
171175Decompress \var {data} in one shot. If you want to decompress data
172176sequentially, use an instance of \class {BZ2Decompressor} instead.
173177\end {funcdesc }
174-
0 commit comments