def curry(_curried_func, *args, **kwargs):

    def _curried(*moreargs, **morekwargs):
        return _curried_func(*(args + moreargs), **dict(kwargs, **morekwargs))
return _curried
How to debug dynamically defined functions in Python?