Python modifying a dictionary with a function call : <p>Here is my code.  I am trying to construct a list of names to create a bunch of defaultdicts.  Then I want to modify these default dicts by calling a function.
Having problems as you can see in the comments.</p>

<pre><code>#!/usr/bin/python                                                                                             

from collections import defaultdict

class Stats(object):
    def __init__(self, name, namedict):
        self.name = name
        self.namedict = namedict
    def update_stats(self, playerdict):
    self.playerdict = playerdict
        playerdict['HR'] += 1
        return(playerdict)


l = ['a', 'b', 'c']

for x in l:
    d = x + 'dict'   # trying to make a list of dict names
    print "Name is",d   # it is a string so far
    d = defaultdict(int)  # now it is a dict but what is its name?
    print d  # i have a structure here but don't know its name

stats = Stats('stats',d)

#   next test code block does not work   

#for k,v in adict.iteritems():   # adict not defined!                                                         
#    print k,v                                                                                                

# next code block does not work either
for y in l:
    dictname = y + 'dict'
    dictname = stats.update_stats(**dictname)    
# it thinks dictname is a        String 
# in general what is the right way to pass in a dictionary 
# and get it back in a modified state? 
</code></pre>
