MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / __init__

Method __init__

24-class-metaprog/hours/hours.py:85–88  ·  view source on GitHub ↗
(self, h: float = 0, m: float = 0, s: float = 0)

Source from the content-addressed store, hash-verified

83 return Hours(h, m, s)
84
85 def __init__(self, h: float = 0, m: float = 0, s: float = 0):
86 if h < 0 or m < 0 or s < 0:
87 raise ValueError('invalid negative argument')
88 self.h, self.m, self.s = normalize(h * 3600 + m * 60 + s)
89
90 def __repr__(self):
91 h, m, s = self

Callers

nothing calls this directly

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected