func_supports_parameter
Checks if a given callable supports a specific parameter by name.
def func_supports_parameter(
func: callable,
name: string
) - > boolean
Determines if a given callable accepts a specific parameter by name. Use this to safely pass arguments to functions with varying signatures without causing TypeError.
Parameters
| Name | Type | Description |
|---|---|---|
| func | callable | The function, method, or callable object to inspect for parameter support. |
| name | string | The specific parameter name to search for within the callable's signature. |
Returns
| Type | Description |
|---|---|
boolean | True if the parameter name exists in the function signature, False otherwise. |