ebanutsya

This commit is contained in:
2023-10-27 06:04:15 +03:00
parent 56792b892d
commit 1d2ee676ff
19 changed files with 196 additions and 13 deletions

7
singleton.py Normal file
View File

@@ -0,0 +1,7 @@
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]