add_to_signature
Full name: ase2sprkkr.bindings.tests.decorators.add_to_signature
- ase2sprkkr.bindings.tests.decorators.add_to_signature(func, prepend=False, excluding=None, kwargs=False)[source]
Add the arguments in the
func
function to the list of arguments of the resulting function (as keyword_only arguments) The modified function has to have its arguments defined as in the following example:def parent(.....): .... @add_to_signature(parent) def child(new_param, *args, **kwargs): print(f'New param is {new_param}) parent(*args, **kwargs)
- Parameters:
func – A function, whose parameters will be added to the resulting function signature.
prepend –
If True, the new positional arguments will be the first. If False, they will be after the parents positional arguments.
The same-named arguments can be given as keyword-only - then they just alter the properties of the “old” arguments, retaining their position. If they are given as regular ones, they takes their new position, too.
excluding – Do not add arguments of this name(s)
kwargs – The resulting function will have kwargs argument