摘要:
1.用 __new__方法 class Singleton(object): def __new__(cls): if not hasattr(cls,'_instance'): cls._instance=super(Singleton,cls).__new__(cls) # cls.__inst 阅读全文
posted @ 2022-08-26 16:11
Python探索牛
阅读(117)
评论(0)
推荐(0)