[x] Replace the allow_kwargs decorator with the allow_only_kwargs decorator
[x] Open issue for further improvements of decorator return types (#80)
The more general decorator allow_kwargs is replaced with the more specific allow_only_kwargs to reduce complexity when developing (i.e., I do not have to think about any mixed-case scenarios) and to throw errors more quickly and with more informative error messages. When working with functions internally, we either want to call them with keyword-only arguments (in which case I do not need the possibility to call them without keyword arguments) or with positional arguments. In the latter case we do not gain anything by implementing an allow_only_args decorator, which is why we stick with the more general one here.
In this PR, I
functools.py
allow_kwargs
decorator with theallow_only_kwargs
decoratorThe more general decorator
allow_kwargs
is replaced with the more specificallow_only_kwargs
to reduce complexity when developing (i.e., I do not have to think about any mixed-case scenarios) and to throw errors more quickly and with more informative error messages. When working with functions internally, we either want to call them with keyword-only arguments (in which case I do not need the possibility to call them without keyword arguments) or with positional arguments. In the latter case we do not gain anything by implementing anallow_only_args
decorator, which is why we stick with the more general one here.