pytoolz/toolz — pull request #217 by Digenis (2014-10-23 05:39:52+00:00)
Title: Remove positional arg "func" from curry.__init__

conflicted with kwargs['func']

example.py:
```python
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)
```
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.

```python
> /home/digenis/src/toolz/toolz/example.py(1)()
-> from toolz import curry
(pdb) c
Traceback (most recent call last):
...
File "/home/digenis/src/toolz/toolz/functoolz.py", line 224, in __call__
return curry(self._partial, *args, **kwargs)
TypeError: __init__() got multiple values for keyword argument 'func'
...
> /home/digenis/src/toolz/toolz/functoolz.py(224)__call__()
-> return curry(self._partial, *args, **kwargs)
(pdb) self._partial # __init__ will receive this as the positional argument "func"

(pdb) pp args
()
(pdb) pp kwargs # but it will also receive a kwarg named "func"
{'func': }

Post mortem debugger finished. The example.py will be restarted
...
```
I abbreviated some line ranges with "..."