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