I think you may need to do something like this in your code, this is what I
will be doing here shortly too
class peanutsdict(dict):
__slots__ = ['defaultZZz']
def __init__(self,default=None):
dict.__init(self)
self.default = default
def __getitem__(self,key):
if key in self:
return dict.__getitem__(self,key)
else:
return self.default
def get(self, key, *args):
if not args:
args = (self.default,)
return dict.get(self, key, *args)
def merge(self, other):
for key in other:
if key not in self:
self[key] = other[key]
-Alex Goretoy
http://www.goretoy.com
--
http://mail.python.org/mailman/listinfo/python-list