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

Method __add__

recipes/Python/502252_Physics/recipe-502252.py:36–38  ·  view source on GitHub ↗

Return the sum of vector addition.

(self, vector)

Source from the content-addressed store, hash-verified

34 return 'Vector(%r, %r)' % (self.x, self.y)
35
36 def __add__(self, vector):
37 'Return the sum of vector addition.'
38 return Vector(self.x + vector.x, self.y + vector.y)
39
40 def __sub__(self, vector):
41 'Return the difference of vector subtraction.'

Callers

nothing calls this directly

Calls 1

VectorClass · 0.70

Tested by

no test coverage detected