singleton.py 173 B

123456
  1. class Singleton(object):
  2. @classmethod
  3. def get_instance(cls):
  4. if not hasattr(cls, "_instance"):
  5. cls._instance = cls()
  6. return cls._instance