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

Method __init__

example_code/item_075.py:55–60  ·  view source on GitHub ↗
(self, height, width)

Source from the content-addressed store, hash-verified

53
54class Grid:
55 def __init__(self, height, width):
56 self.height = height
57 self.width = width
58 self.rows = []
59 for _ in range(self.height):
60 self.rows.append([EMPTY] * self.width)
61
62 def get(self, y, x):
63 return self.rows[y % self.height][x % self.width]

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected