Dictionary of Dicts question

John Townsend jtownsen at adobe.com
Thu Oct 16 21:19:28 CEST 2008

I'm working with a Dictionary of Dicts. Something like this:

myDict = {
                                                'TestName': {

Accessing values is pretty straightforward (nice change from my Perl days). For example:


in Python interpreter yields


However, when I try to add, let's say, a new FileName entry, I end up replacing the previous FileName entry.

In Python interpreter, I try:

myDict['TestName'] = {'NewFileName': {}, }

I get

{'TestName': {'NewFileName': {}}}

So, how do I add a new entry without replacing the old entry?


John Townsend (5-7204),
AGM-FL and PSL QE Lead

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081016/be2f2b1b/attachment.html>

More information about the Python-list mailing list