Skip to main content

head_from_fun

Generate signature function from actual function.

def head_from_fun(
fun: Callable[..., Any],
bound: bool = False
) - > str

Generate signature function from actual function.

Parameters

NameTypeDescription
funCallable[..., Any]The source function, method, or callable object from which to extract the signature.
boundbool = FalseIf True, returns a partial function with a dummy object prepended to the arguments, simulating a bound method.

Returns

TypeDescription
strA new function object with an empty body that mimics the original function's signature, including its source definition stored in the _source attribute.