instance name

max(01)* max2 at fisso.casa
Sat Apr 2 10:48:21 EST 2005


hi.

is there a way to define a class method which prints the instance name?

e.g.:

 >>> class class_1:
...   def myName(self):
...     ????what should i do here????
...
 >>> instance_1 = class_1()
 >>> instance_1.myName()
'instance_1'
 >>>

bye

macs



More information about the Python-list mailing list