Revert "[Add] metaclass of singleton"

This reverts commit b05eb7142e.
This commit is contained in:
vn.py 2019-06-13 20:15:19 +08:00
parent b05eb7142e
commit 40bd01fdff

View File

@ -445,17 +445,3 @@ def virtual(func: "callable"):
that can be (re)implemented by subclasses.
"""
return func
class Singleton(type):
"""
Metaclass for creating singleton object.
"""
_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]