mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353)
This commit is contained in:
parent
d9151cb453
commit
d2a8e69c2c
4 changed files with 15 additions and 0 deletions
|
@ -221,6 +221,10 @@ class LZMAFile(_compression.BaseStream):
|
|||
self._check_can_read()
|
||||
return self._buffer.readline(size)
|
||||
|
||||
def __iter__(self):
|
||||
self._check_can_read()
|
||||
return self._buffer.__iter__()
|
||||
|
||||
def write(self, data):
|
||||
"""Write a bytes object to the file.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue