I would like to retrieve the variable name passed as an argument to a function.
Here is an example of the result I am looking for:
def my_func(a, b):
return a + b
>>> foo, bar = 1, 2
>>> get_arg_var_names(my_func(foo, bar))
foo
bar
Please note that I am not looking retrieve a
and b
.