how do you get the name of a dictionary?

jojoba jojoba12 at hotmail.com
Tue Aug 22 13:45:52 EDT 2006


> Exactly the point that's being made. It's so easy just do it yourself:
> banana={"name":"banana"}
> Hey what is the name of my dictionary?
> banana["name"]
> But why build it into Python and force everyone else to do it, when
> most of the time nobody cares what the name is, or they already know?


Aha.....
my problem, (which as i said before, is not really an important
problem) is to take any dictionary and load it into a tree viewer AND
get the name(s) of that dictionary (if they exist, and if not, so be
it).
Now, that means that a given dictionary might not have the admittedly
super simple method of binding a name to itself (i.e. the
banana={"name":"banana"}).
This has been my issue. And there is no GENERAL solution that currently
exists.
I completely agree with everybody that a draconian solution is not
necessarily optimal, but i havent been convinced that it would
drastically, deleteriously affect python performance.
However, since i am not one of the wonderful people who commit time to
actually coding python, i dont really have a say.  =)
I know i am harping on this, but no one of yet has really proven why
having such a feature would seriously affect python speed.
Any ideas?
jojoba

o(-_-)o




More information about the Python-list mailing list