'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od'

def setdefault(self, key, default=None):

    if (key in self):
        return self[key]
    self[key] = default
    return default
