摘要: 1.__new__特殊方法实现 class Singleton: def __new__(cls, *args, **kwargs): if not hasattr(cls, '_instance'): cls._instance = super(Singleton, cls).__new__(cl 阅读全文
posted @ 2020-09-29 20:49 小小程序员ol 阅读(329) 评论(0) 推荐(0) 编辑