Method to give name of class instance?

Timothy L. Robertson timothyr at timothyr.com
Sun Apr 29 20:22:53 EDT 2001


Hi Everyone,

I've been enjoying learning Python very much, but have hit a little
snag.  I want a way to find out the name of a class instance from a
method.  eg.

>>>classinstance=MyClass()
>>>classinstance.myname()
'classinstance'

Is there a way to do this?

Thanks,
-Tim
timothyr at timothyr.com



More information about the Python-list mailing list