How to obtain an instance's name at runtime?

Greg Ewing greg.ewing at compaq.com
Thu Jun 24 16:43:28 EDT 1999


Joshua Rosen wrote:
> 
>         Instances aren't `definers'--they don't act as the root of the definition for
> `what something is'.

I think it's more a matter of the fact that the syntaxes for
creating classes and functions happen to incorporate a name, 
which Python squirrels away just in case someone is interested
later (which they often are).

When an instance is created, on the other hand, there is
no obvious name available. So, if you want one, you have to
arrange for it yourself.

Greg




More information about the Python-list mailing list