Spaces:
Sleeping
Sleeping
File size: 217 Bytes
ebf0e28 | 1 2 3 4 5 6 7 8 9 10 | def singleton(cls):
instances = {}
def get_instance(*args, **kwargs):
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
return instances[cls]
return get_instance
|