摘要: 1 使用__new__方法 class Singleton(object): def __new__(cls, *args, **kw): if not hasattr(cls, '_instance'): orig = super(Singleton, cls) cls._instance = o 阅读全文
posted @ 2018-04-08 15:06 崔恒跃 阅读(160) 评论(0) 推荐(0) 编辑