运算符重载

class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __invert__(self):
        self.xself.y = self.yself.x


p = Point(13)
~p
# p.x is 3 and p.y is 1


print(p.x, p.y)