sdvillal / whatami

Easily provide python objects with self-identification
Other
9 stars 1 forks source link

Support partial with keyword arguments #13

Open sdvillal opened 7 years ago

sdvillal commented 7 years ago

Currently the strings generated for partials over functions accepting keyword arguments are wrong, or better said, oververbose.

from whatami import what2id
from functools import partial

def f(x, **kwargs):
    return None

fp = partial(f, a=3)
print(what2id(fp))

# Prints:
#   partial(args=(),func=f(),keywords={'a':3})
# Should print:
#   f(a=3)

Also the whatable decorator fails.