wrf.from_args

wrf.from_args(func, argnames, *args, **kwargs)

Return a mapping of argument name to value for the called function.

This function parses the function args and kwargs to obtain the desired argument value. If the argument has not been passed in, the value is taken from the default keyword argument value.

This func is usually called from within a decorator.

Note

This function currently does not work with functions that contain variable length args or kwargs arguments.

Parameters:
  • func (function) – The function to examine (usually the function that is wrapped).
  • argnames (iterable) – An iterable sequence of argument names.
  • *args – The positional arguments.
  • **kwargs – The keyword arguments.
Returns:

A mapping of argument name to argument value.

Return type:

dict