Say I have the following:
def foo(arg1, arg2, arg3 = default, *args, *kwargs*):
"""This function is really cool."""
return
How can I define a new function functionprinter(f) so that functionprinter(f) would print
foo(arg1, arg2, arg3 = default, *args, *kwargs*)
This function is really cool.
or something of that nature? I already know foo.__name__ and foo.__doc__ and have seen the inspect module, specifically here: Getting method parameter names in python but can't seem to string together everything, in particular having the default arguments print properly. I am using Python 3.4.1.