I am doing some python programming and like the dictionaries in python. I am wondering if there is a compact way to access the elements of a dictionary within the dictionary itself? For example see the following code:
MyDict = {'n':1, 's':2}
MyDict.update({'x' : MyDict['n']*2})
Often the dictionary names are long so it would be very convenient to have something like:
MyDict.update({'x' : self['n']*2})
Any idea if there is such a compact form?