bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353)

This commit is contained in:
Inada Naoki 2021-04-13 13:51:49 +09:00 committed by GitHub
parent d9151cb453
commit d2a8e69c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View file

@ -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.