From 40bd01fdffd88d935dee90e87fef607ef6764fb2 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 13 Jun 2019 20:15:19 +0800 Subject: [PATCH] Revert "[Add] metaclass of singleton" This reverts commit b05eb7142e60fd3cb93e6b04e1c7e89746670462. --- vnpy/trader/utility.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/vnpy/trader/utility.py b/vnpy/trader/utility.py index fc4ab4cd..a154e175 100644 --- a/vnpy/trader/utility.py +++ b/vnpy/trader/utility.py @@ -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]