mardi 15 janvier 2019

Getting the name of the input variable from within the function in Python

If say I have something like:

myList = []

and a function:

def f(a):
    ...

and I call the function as such:

f(myList)

then within this function itself, is there a way to obtain the name of the variable that is passed in? (i.e. can I get the value "myList" as a string from within the function?)





Aucun commentaire:

Enregistrer un commentaire