def __init__(self, func): if type(func) is not types.FunctionType and \ type(func) is not types.MethodType: raise ValueError("Must be a function or method") Arrow.__init__(self) self._func = func
def __init__(self, patcher, f): if not isinstance(patcher, types.FunctionType) and not isinstance(patcher, types.MethodType): raise ValueError("Patcher must be a function") if f and (not isinstance(f, types.FunctionType) and not isinstance(f, types.MethodType)): raise ValueError("Function must be a function") Arrow.__init__(self) self._patcher = patcher self._func = f