Maybe this function should overload subtraction (
.__sub__())? In any case, the good old
Pythagorean theorem is all the math we need.
# - - - P t . d i s t def dist(self, other): '''Return the distance between self and other. ''' dx = self.x() - other.x() dy = self.y() - other.y() return num.sqrt ( dx*dx + dy*dy )