7.2.6.22. add_args¶
-
class
add_args
(func, n=1, callback=None)[source]¶ Adds arguments to a function (left side).
Parameters: - func (callable) – Function to wrap.
- n (int) – Number of unused arguments to add to the left side.
Returns: Wrapped function.
Return type: callable
Example:
>>> def original_func(a, b): ... '''Doc''' ... return a + b >>> func = add_args(original_func, n=2) >>> func.__name__, func.__doc__ ('original_func', 'Doc') >>> func(1, 2, 3, 4) 7
Methods
__init__
Initialize self.