Files
ltlnotifyer/utils.py
2022-02-18 15:10:00 +03:00

8 lines
254 B
Python

class Singleton(type):
"""Singleton metaclass"""
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super().__call__(*args, **kwargs)
return cls._instances[cls]