MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / __add__

Method __add__

python/utils.py:42–46  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

40 return hash((self.x, self.y))
41
42 def __add__(self, other) -> Self:
43 if isinstance(other, Point):
44 return Point(self.x + other.x, self.y + other.y)
45 else:
46 raise TypeError
47
48 def taxi_distance(self, other) -> int:
49 return abs(self.x - other.x) + abs(self.y - other.y)

Callers

nothing calls this directly

Calls 1

PointClass · 0.85

Tested by

no test coverage detected