Get the instance name from a list by Reflection

jon vspython jonvspython at gmail.com
Mon Oct 22 11:23:54 EDT 2007


May be, you could check against globals() dictionary looking for matching
id()'s:

def find_name(identifier):
     for k,v in globals().items():
             if id(v) == id(identifier):
                     return k
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071022/b2960682/attachment.html>


More information about the Python-list mailing list