From d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 13 Apr 2021 13:51:49 +0900 Subject: bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353) --- Lib/gzip.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/gzip.py') diff --git a/Lib/gzip.py b/Lib/gzip.py index 0a8993ba35..9a4e0f9c00 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -398,6 +398,10 @@ class GzipFile(_compression.BaseStream): self._check_not_closed() return self._buffer.readline(size) + def __iter__(self): + self._check_not_closed() + return self._buffer.__iter__() + class _GzipReader(_compression.DecompressReader): def __init__(self, fp): -- cgit v1.2.1