@@ -91,7 +91,7 @@ The :mod:`bz2` module contains:
9191 and :meth: `~io.IOBase.truncate `.
9292 Iteration and the :keyword: `with ` statement are supported.
9393
94- :class: `BZ2File ` also provides the following method :
94+ :class: `BZ2File ` also provides the following methods :
9595
9696 .. method :: peek([n])
9797
@@ -106,14 +106,52 @@ The :mod:`bz2` module contains:
106106
107107 .. versionadded :: 3.3
108108
109+ .. method :: fileno()
110+
111+ Return the file descriptor for the underlying file.
112+
113+ .. versionadded :: 3.3
114+
115+ .. method :: readable()
116+
117+ Return whether the file was opened for reading.
118+
119+ .. versionadded :: 3.3
120+
121+ .. method :: seekable()
122+
123+ Return whether the file supports seeking.
124+
125+ .. versionadded :: 3.3
126+
127+ .. method :: writable()
128+
129+ Return whether the file was opened for writing.
130+
131+ .. versionadded :: 3.3
132+
133+ .. method :: read1(size=-1)
134+
135+ Read up to *size * uncompressed bytes, while trying to avoid
136+ making multiple reads from the underlying stream. Reads up to a
137+ buffer's worth of data if size is negative.
138+
139+ Returns ``b'' `` if the file is at EOF.
140+
141+ .. versionadded :: 3.3
142+
143+ .. method :: readinto(b)
144+
145+ Read bytes into *b *.
146+
147+ Returns the number of bytes read (0 for EOF).
148+
149+ .. versionadded :: 3.3
150+
109151
110152 .. versionchanged :: 3.1
111153 Support for the :keyword: `with ` statement was added.
112154
113- .. versionchanged :: 3.3
114- The :meth: `fileno `, :meth: `readable `, :meth: `seekable `, :meth: `writable `,
115- :meth: `read1 ` and :meth: `readinto ` methods were added.
116-
117155 .. versionchanged :: 3.3
118156 Support was added for *filename * being a :term: `file object ` instead of an
119157 actual filename.
0 commit comments