-
Notifications
You must be signed in to change notification settings - Fork 270
Remove positional arg "func" from curry.__init__ #217
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
Conversation
|
Why did the wrong pypy builds succeed? |
|
This looks good. The only thing I would suggest is to include your (very clear) example as a test to ensure that this behavior continues to work in the future. |
|
Do you mean a test for the signature of curry()? |
|
I think that the example that you gave: from toolz import curry
@curry
def foo(x, y, func=int, bar=str):
return str(func(x*y))
foo(bar=float)(4.2, 3.8, func=round)
foo(func=int)(4.2, 3.8, bar=str)Is a good test case here. I would just execute that in a test. Presumably the current implementation of toolz would fail this test. |
|
Yes. I hesitated committing because it doesn't make sense to me. It just checks this specific name, "func". |
|
OK, I figured what's funny with the build. I 'll need some time for it. |
|
This looks good to me. It appears the error is with pypy's version of The easiest way forward is to probably just skip the failing test if the platform is pypy. This can be done programmatically via |
|
Yes, this is what I figured too but I had no time to try fixing pypy and see if it still happens. Funny fact, pypy's partial (which breaks) has exactly the same issue, and the argument is also named func. I will surely have the time to look into it next week. |
|
I sent a patch to pypy an hour ago. |
|
I fixed the pypy bug months ago. |
|
Mostly the reason is that we check these things less frequently than we should. I've triggered a travis.ci build. |
|
Looks like there is still a pypy3 bug. The CPython errors are pep8 issues. |
|
It is merged into pypy3 From the build I can see pypy2 2.5 succeeds Travis doesn't have its latest version, (also: to rebase or not?) |
|
Do you want me to temporarily ignore the test for pypy3 |
|
Yeah, that'd be great to skip the failing tests for pypy3. I'll merge as soon as the tests pass. Also, would you like to add yourself to AUTHORS.md? Thanks for your persistence and patience--and for finding and fixing a bug in PyPy! |
conflicted with kwargs['func']
revert this after pypy3 2.5 release
|
I rebased because of a merge conflict with another contributor addition. |
|
Very nice. Welcome to PyToolz! |
Remove positional arg "func" from curry.__init__
|
Thank you. |
|
just a reminder that 899a932 can be reverted |
conflicted with kwargs['func']
example.py:
The last line would throw
TypeError: __init__() got multiple values for keyword argument 'func'because
curry.__init__(self, func, *args, **kwargs)names its first positional argument "func"This effectively prevented creating a curry object with such a kwarg.
I didn't find other functions with the same problem.
I abbreviated some line ranges with "..."