1__doc__ = u""" 2 >>> p = Point(1,2,3) 3 >>> p.gettuple() 4 (1.0, 2.0, 3.0) 5 >>> q = p + Point(2,3,4) 6 >>> q.gettuple() 7 (3.0, 5.0, 7.0) 8 >>> p.gettuple() 9 (1.0, 2.0, 3.0) 10""" 11 12cdef class Point: 13 cdef double x, y, z 14 def __init__(self, double x, double y, double z): 15 self.x = x 16 self.y = y 17 self.z = z 18 19 # XXX: originally, this said "def __add__(self, other)" 20 def __add__(Point self, Point other): 21 return Point(self.x + other.x, self.y + other.y, self.z + other.z) 22 23 def gettuple(self): 24 return (self.x, self.y, self.z) 25