You also could use a list to represent your data, then you get more
dimensions supported, e.g:
import math
class Point:
        def __init__(self, *args):
                self.points = list(args)

def dist(x, y):
        if len(x.points) != len(y.points):
                raise RuntimeError('dimensions not the same')
        d = 0
        for i in range(len(x.points)):
                d += (x.points[i] - y.points[i])**2
        return math.sqrt(d)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to