if default_arg.has_default:
    args.append('%s=%s' % (arg, default_arg.default_value))
else:
    args.append(arg)
arg_index += 1
return '%s(%s)' % (method.__name__, ', '.join(args))
if __name__ == '__main__':

    def my_method(first_arg, second_arg=42, third_arg='something'):
        pass
print(get_method_sig(my_method))
How can I read a function's signature including default argument values?