def __init__(self, pairs): defaultdict.__init__(self, list) for key, value in pairs: self[key].append(value)