MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __iter__

Method __iter__

example_code/item_021.py:131–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

129 self.data_path = data_path
130
131 def __iter__(self):
132 with open(self.data_path) as f:
133 for line in f:
134 yield int(line)
135
136
137print("Example 11")

Callers

nothing calls this directly

Calls 1

openFunction · 0.85

Tested by

no test coverage detected