From: Dmitry Selyutin Date: Tue, 13 Jun 2023 20:39:22 +0000 (+0300) Subject: core: drop wrapper argument X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aab60a0f2c9423a6920a16cd88a41ecc7d8c55bd;p=mdis.git core: drop wrapper argument --- diff --git a/src/mdis/core.py b/src/mdis/core.py index 0af0e53..708f8d2 100644 --- a/src/mdis/core.py +++ b/src/mdis/core.py @@ -1,10 +1,9 @@ class TypeidHook(object): - def __init__(self, *typeids, wrapper=lambda call: call): + def __init__(self, *typeids): for typeid in typeids: if not isinstance(typeid, type): raise ValueError(typeid) self.__typeids = typeids - self.__wrapper = wrapper return super().__init__() def __iter__(self): @@ -16,17 +15,17 @@ class TypeidHook(object): def __call__(self, call): if not callable(call): raise ValueError(call) - return CallHook(typeids=self, call=call, wrapper=self.__wrapper) + return CallHook(typeids=self, call=call) class CallHook(object): - def __init__(self, typeids, call, wrapper=lambda call: call): + def __init__(self, typeids, call): if not isinstance(typeids, TypeidHook): raise ValueError(typeids) if not callable(call): raise ValueError(call) self.__typeids = typeids - self.__call = wrapper(call) + self.__call = call return super().__init__() def __repr__(self):