手写一个单例

2020-01-31T12:22:15
#python2
class A(object):
    __instance = None
    def __new__(cls,*args,**kwargs):
        if cls.__instance is None:
            cls.__instance = objecet.__new__(cls)
            return cls.__instance
        else:
            return cls.__instance
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »