class View:
_instance = None
def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = super(View, cls).__new__(cls)
return cls._instance
def __init__(self):
pass
def __call__(self, *args, **kwargs):
pass
def instance(*_func_args):
def _init_wrapper(cls):
_instance_obj = cls()
if _func_args:
for init_args in _func_args:
_instance_obj = init_args(_instance_obj)
def _cls_instance(*args, **kwargs):
return _instance_obj(*args, **kwargs)
return _cls_instance
return _init_wrapper