Suor/funcy

funcy.autocurry doesn't work with functions with key-words only

Closed this issue · 4 comments

Hi! I'm happy to use the library but looks like I found a bug:

>>>@funcy.autocurry
...def a(b, c): return b + c

>>>a(c=1)(2)
3

>>>@funcy.autocurry
...def aa(b, *, c): return b + c

>>>aa(c=1)
Traceback (most recent call last):
   ...
TypeError: aa() missing 1 required keyword-only argument: 'c'

funcy version: 1.17

Suor commented
Suor commented

There are several points in funcy where it fails with kwonly args. Looks like fixing it is complicated by Python 2 support. I will consider dropping it and then fixing this stuff.

Suor commented

So, dropped Python 2 recently. Improved positional only and kw only args support in @decorator.

Suor commented

Fixed in 5dc4547.