def my_func(a, *args, **kwargs):
    saved_args = locals()
print(('saved_args is', saved_args))
local_var = 10
print(('saved_args is', saved_args))
print(('But locals() is now', locals()))
Getting all arguments and values passed to a Python function