from collections import defaultdict


def create_dict2(l):
    """
    Group a seq of key-value pairs into dictionary of list.
    Using defaultdict is more efficient than setdefault --
    But, it's not equiv to create_dict because it does not
    generate Error when key not in dict

    EXAMPLES:
    >>> create_dict2([('a',1),['b',2],('a',3),('c',4),('b',10)])
    defaultdict(<type 'list'>, {'a': [1, 3], 'c': [4], 'b': [2, 10]})

    >>> d = create_dict2([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)]); d.items()
    [('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
    >>> d['x']
    []
    """

    d = defaultdict(list)
    for k, v in l:
        d[k].append(v)

    return d