MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / __iter__

Method __iter__

functional/io.py:137–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

135 )
136
137 def __iter__(self):
138 if "t" in self.mode:
139 with gzip.GzipFile(self.path, compresslevel=self.compresslevel) as gz_file:
140 gz_file.read1 = gz_file.read
141 with io.TextIOWrapper(
142 gz_file,
143 encoding=self.encoding,
144 errors=self.errors,
145 newline=self.newline,
146 ) as file_content:
147 for line in file_content:
148 yield line
149 else:
150 with gzip.open(
151 self.path, mode=self.mode, compresslevel=self.compresslevel
152 ) as file_content:
153 for line in file_content:
154 yield line
155
156 def read(self):
157 with gzip.GzipFile(self.path, compresslevel=self.compresslevel) as gz_file:

Callers

nothing calls this directly

Calls 1

openMethod · 0.80

Tested by

no test coverage detected