class Point: def __init__(self, x, y): self.x = x self.y = y def __invert__(self): self.x, self.y = self.y, self.xp = Point(1, 3)~p# p.x is 3 and p.y is 1print(p.x, p.y)