Referencing a list element by it's name
<p>I'm trying to scan through a list of dictionary references to get the number of keys in each dictionary.  How do I go about referencing an element's name as opposed to the content of the dictionary?  Each of the elements in the audit_dicts list is a reference to an existing dictionary.</p>

<pre><code>audit_dicts = [ osdata, weblogic, tomcat ]
for i in audit_dicts:
    print "Length of the %s dictionary is %d lines." % (i.name(), len(i))
</code></pre>

<p>I understand that it has to do with the contents type being a dictionary, but is there no way to print the name of the element in the list?  I'm essentially using the list to store all of these dictionaries, so that I can perform multiple actions on them in a single loop.  Also, is there a way to declare these dictionaries within the same loop?  What is the pythonic way of doing so?  I currently have a bout 20 different dicitonaries of data, but I've only been able to to delcare each one individually before building the dictionary from web data.</p>

<pre><code>for i in audit_dicts:
    i = {}
</code></pre>
