You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The decorator boltons.funcutils.wraps seems to lose keywords passed to the wrapped function. This does not happen with functools.wraps.
Here is a silly example:
fromboltons.funcutilsimportwrapsdefflip(f):
@wraps(f)defwrapper(*args, **kwargs):
returnf(*reversed(args), **kwargs)
returnwrapperdefpow(x, y, msg=""):
"""Print msg and raise x to the power of y."""print(f"{x=}, {y=}")
ifmsg:
print(f"{msg=}")
result=x**yprint(f"{result=}")
returnresultflipped_pow=flip(pow)
flipped_pow(3, 2, msg="abc")
Thanks for the great project!
The decorator
boltons.funcutils.wraps
seems to lose keywords passed to the wrapped function. This does not happen withfunctools.wraps
.Here is a silly example:
Expected:
Actual:
TypeError
I also noticed that if I make msg keyword only, as below, it works:
The text was updated successfully, but these errors were encountered: