lisa.utils.sig_bind#
- lisa.utils.sig_bind(sig, args, kwargs, partial=True, include_defaults=True)[source]#
Similar to
inspect.Signature.bind()
but expands variable keyword arguments so that the resulting dictionary can be used directly in a function call.- The function returns a
(kwargs, missing)
with: missing
a set of the missing mandatory parameters.kwargs
a dictionary of parameter names to values, ready to be used to call a function.
- Parameters:
sig (inspect.Signature) – Signature to extract parameters from.
partial (bool) – If
True
, behave likeinspect.Signature.bind_partial()
. Otherwise, behave likeinspect.Signature.bind()
.include_defaults (bool) – If
True
, the returnedkwargs
will include the default values.
- The function returns a