Roel Schroeven wrote: > ... > Christophe schreef: >> ... >>And what about a function which computes the line length ? > > That would have been a better example indeed, since the *p1 trick > doesn't work there. > > def euclidian_distance((x1, y1), (x2, y2)): > return math.sqrt((x2 - x1)**2 + (y2 - y1)**2) > > That's a lot nicer, I think, than this: > > def euclidian_distance(p1, p2): > return math.sqrt((p2[0] - p1[0])**2 + (p2[1] - p1[1])**2)
But not massively nicer than: def euclidian_distance(p1, p2): (x1, y1), (x2, y2) = p1, p2 return math.sqrt((x2 - x1)**2 + (y2 - y1)**2) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list