bilby.core.utils.introspection.infer_args_from_function_except_n_args
- bilby.core.utils.introspection.infer_args_from_function_except_n_args(func, n=1)[source]
Inspects a function to find its arguments, and ignoring the first n of these, returns a list of arguments from the function’s signature.
This function is intended to allow the handling of named arguments in both functions and methods; this is important, since the first argument of an instance method will be the instance.
- Parameters:
- funcfunction or method
The function from which the arguments should be inferred.
- nint
The number of arguments which should be ignored, staring at the beginning.
- Returns:
- parameters: list
A list of parameters of the function, omitting the first n.
See also
infer_args_from_method
Provides the arguments for a method
infer_args_from_function
Provides the arguments for a function
infer_args_from_function_except_first_arg
Provides all but first argument of a function or method.
Examples
>>> def hello(a, b, c, d): >>> pass >>> >>> infer_args_from_function_except_n_args(hello, 2) ['c', 'd']