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

Method __init__

example_code/item_109.py:52–55  ·  view source on GitHub ↗
(self, timer)

Source from the content-addressed store, hash-verified

50print("Example 1")
51class Toaster:
52 def __init__(self, timer):
53 self.timer = timer
54 self.doneness = 3
55 self.hot = False
56
57 def _get_duration(self):
58 return max(0.1, min(120, self.doneness * 10))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected