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

Method __iter__

example_code/item_076.py:208–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206
207 print("Example 12")
208 def __iter__(self):
209 while True:
210 number = self.request_number()
211 decision = self.report_outcome(number)
212 yield number, decision
213 if decision == CORRECT:
214 return
215
216
217print("Example 13")

Callers

nothing calls this directly

Calls 2

request_numberMethod · 0.95
report_outcomeMethod · 0.95

Tested by

no test coverage detected