class Singleton(object): @classmethod def get_instance(cls): if not hasattr(cls, "_instance"): cls._instance = cls() return cls._instance