getting an object name

David Bear David.Bear at asu.edu
Wed Jun 22 02:08:35 EDT 2005


Let's say I have a list called, alist. If I pass alist to a function,
how can I get the name of it?

alist = range(10)

def afunction(list):
    listName = list.__name__ (fails for a list object)




More information about the Python-list mailing list