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):
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):