单例实现
class User: __instance = None def __new__(cls, *args, **kwargs): if not cls.__instance: cls.__instance = super().__new__(cls) # 记录创建的对象 return cls.__instance