How can I get the name of an object???
scarblac-spamtrap at pino.selwerd.nl
Thu Apr 27 17:07:55 CEST 2000
spex66 at my-deja.com wrote in comp.lang.python:
> In article <etd8zy03m44.fsf at w20-575-108.mit.edu>,
> Alex <cut_me_out at hotmail.com> wrote:
> > An object could be referred to by any number of names:
> > dd = zz ()
> > ee = dd
> > Which name for the object do you wish to know? ee or dd?
> dd or in other words, the name of the FIRST made instance...
What would happen in the following cases:
dd = zz()
ee = dd
dd = [xx(), yy(), zz()]
Classes have a name (the one used in their class: statement).
Instances have no name, period.
But why would you need it? In most cases where people try to use something
like this, dictionaries are a solution.
Remco Gerlich, scarblac at pino.selwerd.nl
"This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context" (David Moser)
More information about the Python-list