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

Class FixedResistance

example_code/item_058.py:151–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150print("Example 11")
151class FixedResistance(Resistor):
152 def __init__(self, ohms):
153 super().__init__(ohms)
154
155 @property
156 def ohms(self):
157 return self._ohms
158
159 @ohms.setter
160 def ohms(self, ohms):
161 if hasattr(self, "_ohms"):
162 raise AttributeError("Ohms is immutable")
163 self._ohms = ohms
164
165
166print("Example 12")

Callers 1

item_058.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected