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

Method __init__

example_code/item_054.py:154–157  ·  view source on GitHub ↗
(self, switch=None, machines=None)

Source from the content-addressed store, hash-verified

152print("Example 8")
153class DatacenterRack(ToDictMixin, JsonMixin):
154 def __init__(self, switch=None, machines=None):
155 self.switch = Switch(**switch)
156 self.machines = [
157 Machine(**kwargs) for kwargs in machines]
158
159class Switch(ToDictMixin, JsonMixin):
160 def __init__(self, ports=None, speed=None):

Callers

nothing calls this directly

Calls 2

SwitchClass · 0.85
MachineClass · 0.85

Tested by

no test coverage detected