摘要: 1 使用__new__方法 class Singleton(object): def __new__(cls, *args, **kw): if not hasattr(cls, '_instance'): orig = super(Singleton, cls) cls._instance = o 阅读全文
posted @ 2018-02-25 10:27 雪纷飞 阅读(228) 评论(0) 推荐(0) 编辑