How to use the pypeline.core.arrows.arrow.Arrow.__init__ function in Pypeline

To help you get started, we’ve selected a few Pypeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ianj-als / pypeline / src / pypeline / core / arrows / function_arrow.py View on Github external
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
github ianj-als / pypeline / src / pypeline / core / arrows / kleisli_arrow.py View on Github external
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