From aab60a0f2c9423a6920a16cd88a41ecc7d8c55bd Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 13 Jun 2023 23:39:22 +0300 Subject: [PATCH] core: drop wrapper argument --- src/mdis/core.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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): -- 2.30.2