how do you get the name of a dictionary?

Giles Brown giles_brown at hotmail.com
Fri Aug 25 05:30:48 EDT 2006


jojoba wrote:
> Does anyone know how to find the name of a python data type.
> Conside a dictionary:
> Banana = {}
>
> Then, how do i ask python for a string representing the name of the
> above dictionary (i.e. 'Banana')?

As many people have already said this question doesn't really make
sense, but
I thought I'd add my explanation of why in the hope that it might
help...

Think of python objects as being like mobile phones.  They only really
have a number.
Asking what their name is like asking for the name of a mobile phone
(bluetooth excepted).
A particular mobile phone only has a name when entered into the address
book (aka
namespace) of another mobile (or whatever) and the choice of name is
down to the owner of the address book.

Now I'm going to eat my cake.

Giles




More information about the Python-list mailing list