5 lines
102 B
Python
5 lines
102 B
Python
def singleton(cls):
|
|
instance = cls()
|
|
cls.__call__ = lambda self: instance
|
|
return instance
|