dictionary update

Chris cfriedl at bigpond.net.au
Tue Aug 15 07:41:00 EDT 2006


I have a instance attribute self.xds and a local variable xds in the 
instance . Both are dictionaries. I understand that I can update 
self.xds with xds as follows: self.xds.update(xds)

However I have many instance attributes, self.i, and local variables i.
I'd like to be able to do this:

for i in list_of_i's:
     self.i.update(i)

How can this be done (I'm assuming it can be).

thx Chris



More information about the Python-list mailing list