📜  单例设计模式示例 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:16.859000             🧑  作者: Mango

代码示例2
class Singleton(object):
    __instance = None
    def __new__(cls, *args):
        if cls.__instance is None:
            cls.__instance = object.__new__(cls, *args)
        return cls.__instance