Entry
Can I get the variable name of an object instance?
Mar 1st, 2000 21:50
Nathan Wallace, Fredrik Lundh
Sorry, you can't do that.
Names are just names, not identities. Any object can have lots of
different names, or none at all.
an example:
clown = Hello(1)
bobo = clown
# here, bobo and clown both point to
# the same instance
del clown
# now, only bobo points to that instance
mylist = [bobo]
del bobo
# and here, nobody points directly to the
# instance.
If you want to get the name of the class for an object instance, see
here:
http://www.faqts.com/knowledge-base/view.phtml/aid/1328/fid/242