name of an instance

andrea valle andrea.valle at
Mon Nov 1 22:09:03 CET 2004

That was a possibility. But my idea was to not requiring the instance 
to know explicitly about its name. I solved passing my receiving object 
not the instance's name, but the instance directly.


On 1 Nov 2004, at 20:03, Terry Reedy wrote:

> "andrea valle" <andrea.valle at> wrote in message
> news:6FAE7CBE-2BF1-11D9-841C-0003939C968C at
>> How do I access the name of an instance?
> By giving __init__ a name param that you store as so that the
> instance really has a name.  (def and class statements do something
> similar)
> ---
> class MyClass:
>   def __init__(self, name='No name'):
> = name
>   def __str__(self): return
> Terry J. Reedy
> -- 
Andrea Valle
Laboratorio multimediale "G. Quazza"
Facoltà di Scienze della Formazione
Università degli Studi di Torino
andrea.valle at

More information about the Python-list mailing list