drop_parameter

utilipy.utils.inspect.drop_parameter(sig: inspect.Signature, param: Optional[Union[str, int, inspect.Parameter]])inspect.Signature[source]

Drop a Parameter.

Parameters
sigSignature

Signature object

param: str, int, Parameter

the parameter to drop in self.parameters identified by either the name (str) or index (int) (Parameter type calls name) If None, does not drop anything

Returns
Signature:

a new Signature object with the replaced parameter