String of function definition signature

    Args:
        func (function): live python function

    Returns:
        str: defsig

    CommandLine:
        python -m utool.util_str --exec-func_defsig

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_str import *  # NOQA
        >>> func = func_str
        >>> defsig = func_defsig(func)
        >>> result = str(defsig)
        >>> print(result)
        func_str(func, args=[], kwargs={}, type_aliases=[], packed=False, packkw=None, truncate=False)

def func_defsig(func, with_name=True):
    """
    String of function definition signature

    Args:
        func (function): live python function

    Returns:
        str: defsig

    CommandLine:
        python -m utool.util_str --exec-func_defsig

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_str import *  # NOQA
        >>> func = func_str
        >>> defsig = func_defsig(func)
        >>> result = str(defsig)
        >>> print(result)
        func_str(func, args=[], kwargs={}, type_aliases=[], packed=False, packkw=None, truncate=False)
    """
    import inspect
    argspec = inspect.getargspec(func)
    (args, varargs, varkw, defaults) = argspec
    defsig = inspect.formatargspec(*argspec)
    if with_name:
        defsig = get_callable_name(func) + defsig
    return defsig