fun_takes_argument
Determines if a given function accepts a specific argument by name or position, accounting for variable arguments and keyword arguments.
def fun_takes_argument(
name: string,
fun: callable,
position: integer = null
) - > boolean
Determines if a callable accepts a specific argument by name or position, or if it accepts arbitrary arguments via variable-length parameters.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the parameter to check for in the function's signature. |
| fun | callable | The function or callable object to inspect for parameter compatibility. |
| position | integer = null | The zero-based positional index to check against the function's required or optional arguments. |
Returns
| Type | Description |
|---|---|
boolean | True if the function can accept the argument through a named parameter, a positional index, or catch-all *args/**kwargs; otherwise False. |