(func)
return dict(list(zip(args, defaults)))
returns a dictionary of arg_name:default_values for the input function
returns a dictionary of arg_name:default_values for the input function
returns a dictionary of arg_name : default_values for the input function
def get_args(func):
    """
    returns a dictionary of arg_name:default_values for the input function
    """
    args, varargs, keywords, defaults = inspect.getargspec(func)

    defaults = list(reversed(defaults)) if defaults is not None else []
    args = list(reversed(args))

    while len(defaults) != len(args):
        defaults += (None,)

    return dict(list(zip(args, defaults)))
def get_args ( func ) : args , varargs , keywords , defaults = inspect . getargspec ( func ) defaults = list ( reversed ( defaults ) ) if defaults is not None else [ ] args = list ( reversed ( args ) ) while len ( defaults ) != len ( args ) : defaults += ( None , ) return dict ( list ( zip ( args , defaults ) ) )