MCPcopy Create free account
hub / github.com/ActiveState/code / __add__

Method __add__

recipes/Python/578006_vector/recipe-578006.py:108–111  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

106 # Binary Arithmetic Operations
107
108 def __add__(self, obj):
109 if isinstance(obj, Vector2):
110 return Vector2(self.x + obj.x, self.y + obj.y)
111 return Vector2(self.x + obj, self.y + obj)
112
113 def __sub__(self, obj):
114 if isinstance(obj, Vector2):

Callers

nothing calls this directly

Calls 1

Vector2Class · 0.70

Tested by

no test coverage detected