get instance name inside of member function

Ralf Oberländer ralf.oberlaender at emsys.de
Thu Jan 9 09:26:39 EST 2003


Hi gurus,

is it possible to get the name of the instance inside a member function:

class a:
     def inst_name():
         pass

inst=a

so that

inst.inst_name()

results in the string "inst"

I need it for logging

Ralf





More information about the Python-list mailing list