I should also add the most simple and obvious implementation which is also the fastest:
class Test:
def __init__(self, dict):
self.somedict = dict
def updateit(self, **mydict):
errdict = {}
for k, v in mydict.iteritems():
if k not in self.somedict:
self.somedict[k] = v
errdict[k] = v
if (not errdict):
raise Exception(errdict)
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor
