import tuple3d def swap_x(p, q): t = p.x p.x = q.x q.x = t p = tuple3d.Point(1,2,3) q = tuple3d.Point(3,4,5) swap_x(p, q) print 'p:', p print 'q:', q