how do you get the name of a dictionary?

BartlebyScrivener rpdooling at gmail.com
Tue Aug 22 13:12:00 EDT 2006


>> how difficult would it be to assign a string name(s)
>> to an object upon creation (and upon referencing)?

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?

It's like forcing everybody everywhere always and forever to wear
"Hello My Name Is" tags.

rd




More information about the Python-list mailing list