I'd like to know what the variable name was that was passed into a function. Is this possible in Python?
Consider this case:
john = 199
def foo(userId:int)->float:
age = get_age_by_id(userId)
return age
I'd like to log something like:
foo(john)
>>> Called with userId = 199 # john
So, I am looking for a way to "peek" at the variable name that was passed as an argument to the function.
Any ideas?