A class question
Bruno Desthuilliers
bruno.42.desthuilliers at wtf.websiteburo.oops.com
Mon Oct 29 07:33:36 EDT 2007
Hrvoje Niksic a écrit :
> Donn Ingle <donn.ingle at gmail.com> writes:
>
>> Is there a way I can, for debugging, access the instance variable name from
>> within a class?
>> E.g:
>> Class X:
>> def debug(self):
>> print "My instance var is %s" % (some magic Python stuff)
>
> As others have answered, an instance can live in many variables,
"be bound to many names" would be more accurate IMHO. Python's
"variables" are name=>object bindings.
More information about the Python-list
mailing list