funcy icon indicating copy to clipboard operation
funcy copied to clipboard

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

Open ADR-007 opened this issue 2 years ago • 2 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

ADR-007 avatar Mar 06 '22 19:03 ADR-007

Can you write a test?

Suor avatar Mar 06 '22 19:03 Suor

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 avatar Apr 28 '22 04:04 Suor