Common: Rever singleton from WeakValueDictionary to simple dictionary

This commit is contained in:
vakarisz 2022-05-02 14:52:46 +03:00
parent f3a5a7090b
commit e89589762e
1 changed files with 1 additions and 6 deletions

View File

@ -1,8 +1,3 @@
# abstract, static method decorator
# noinspection PyPep8Naming
from weakref import WeakValueDictionary
class abstractstatic(staticmethod): class abstractstatic(staticmethod):
__slots__ = () __slots__ = ()
@ -14,7 +9,7 @@ class abstractstatic(staticmethod):
class Singleton(type): class Singleton(type):
_instances = WeakValueDictionary() _instances = {}
def __call__(cls, *args, **kwargs): def __call__(cls, *args, **kwargs):
if cls not in cls._instances: if cls not in cls._instances: