aboutsummaryrefslogtreecommitdiff
path: root/autogpt/singleton.py
diff options
context:
space:
mode:
Diffstat (limited to 'autogpt/singleton.py')
-rw-r--r--autogpt/singleton.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/autogpt/singleton.py b/autogpt/singleton.py
deleted file mode 100644
index b3a5af529..000000000
--- a/autogpt/singleton.py
+++ /dev/null
@@ -1,22 +0,0 @@
-"""The singleton metaclass for ensuring only one instance of a class."""
-import abc
-
-
-class Singleton(abc.ABCMeta, type):
- """
- Singleton metaclass for ensuring only one instance of a class.
- """
-
- _instances = {}
-
- def __call__(cls, *args, **kwargs):
- """Call method for the singleton metaclass."""
- if cls not in cls._instances:
- cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
- return cls._instances[cls]
-
-
-class AbstractSingleton(abc.ABC, metaclass=Singleton):
- """
- Abstract singleton class for ensuring only one instance of a class.
- """