Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currying #76

Open
Comecacahuates opened this issue Jul 26, 2015 · 1 comment
Open

Currying #76

Comecacahuates opened this issue Jul 26, 2015 · 1 comment

Comments

@Comecacahuates
Copy link

I tried this code for function currying

from fn.func import curried
@curried
def sum5(a, b, c, d, e):
    return a + b + c + d + e

sum5(1)(2)(3)(4)(5)
15
sum5(1, 2, 3)(4, 5)
15

but when I call the function I get the following error

Traceback (most recent call last):
File "", line 1, in
File "fn/func.py", line 83, in _curried
return curried(partial(func, _args, *_kwargs))
File "fn/func.py", line 69, in curried
@wraps(func)
File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'functools.partial' object has no attribute 'module'

@cad106uk
Copy link

Hello,

I have written a pull request dealing with this exact problem #75

However as you can see it has been sitting around for a while. I am not sure if this project is being actively maintain at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants